[patch] wrap debugging code

Bernhard Fischer rep.nop at aon.at
Wed Feb 8 15:39:30 UTC 2006


On Tue, Feb 07, 2006 at 11:50:06PM -0500, Mike Frysinger wrote:
>On Saturday 28 January 2006 13:39, Bernhard Fischer wrote:

>> -/*
>> +/*
>
>again, whitespace changes shouldnt be in patches for review :P

You tend not to ack but just check the patches in, so i'm always
tempted to leave the whitespace changes in. Next time i'll apply them
beforehand and drop them from patches.

>>      else {
>> -       int ret;
>> +       __MALLOC_DO_DEBUG(int ret;)
>>         size_t offset = p->prev_size;
>>         av->n_mmaps--;
>>         av->mmapped_mem -= (size + offset);
>> -       ret = munmap((char*)p - offset, size + offset);
>> +       __MALLOC_DO_DEBUG(ret =) munmap((char*)p - offset, size + offset;)
>>         /* munmap returns non-zero on failure */
>>         assert(ret == 0);
>
>better to just assert the munmap call rather than track its ret status

I see you checked this snippet in:
+       assert(munmap((char*)p - offset, size + offset) == 0);

Well, are you sure that now do_munmap() is called if compiling with
NDEBUG defined?

I know that the define doesn't look clean at all, but at least it made
sure that the stuff it's supposed to do is accually there after the
preprocessor was run :P

cheers,
Bernhard



More information about the uClibc mailing list