[patch] wrap debugging code

Mike Frysinger vapier at gentoo.org
Wed Feb 8 04:50:06 UTC 2006


On Saturday 28 January 2006 13:39, Bernhard Fischer wrote:
>  /* Prepare for the case that `__builtin_expect' is not available.  */
> -#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
> +#if (defined __GNUC__ && (__GNUC__ == 2 && __GNUC_MINOR__ < 96))
>  # define __builtin_expect(x, expected_value) (x)

i dont see the point in this change ... if something is undefined, gcc treats 
it as a "0" iirc

> -/*
> +/*

again, whitespace changes shouldnt be in patches for review :P

>      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
-mike



More information about the uClibc mailing list