This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] malloc: fix compile error


On 10/30/19 3:27 AM, liqingqing wrote:
> On 2019/10/30 14:36, Liusirui wrote:
>> Since e9c4fe93b3855239752819303ca377dff0ed0553, the commit changes struct
>> malloc_chunk member "size" to "mchunk_size". This cause a compile error
>> in function dump_heap, if macros MALLOC_DEBUG has defined and the value is
>> larger 1.
>>
>> ---
>>   malloc/arena.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/malloc/arena.c b/malloc/arena.c
>> index 74815ac..be5c9f9 100644
>> --- a/malloc/arena.c
>> +++ b/malloc/arena.c
>> @@ -419,13 +419,13 @@ dump_heap (heap_info *heap)
>>                      ~MALLOC_ALIGN_MASK);
>>     for (;; )
>>       {
>> -      fprintf (stderr, "chunk %p size %10lx", p, (long) p->size);
>> +      fprintf (stderr, "chunk %p size %10lx", p, (long) chunksize_nomask(p));
>>         if (p == top (heap->ar_ptr))
>>           {
>>             fprintf (stderr, " (top)\n");
>>             break;
>>           }
>> -      else if (p->size == (0 | PREV_INUSE))
>> +      else if (chunksize_nomask(p) == (0 | PREV_INUSE))
>>           {
>>             fprintf (stderr, " (fence)\n");
>>             break;
>>
> 
> I think you can give more details about the error like the compile
> step. and so that the other guys may get more information.
> 

Agreed. The commit message should say which error and which compiler
version generated the error.

We still can't accept patches from Huawei yet because copyright assignment
has not been completed. But thanks for the review!

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]