bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex no longer needs to depend on malloc-gnu


From: Nathan Kennedy
Subject: Re: regex no longer needs to depend on malloc-gnu
Date: Fri, 18 Apr 2014 10:47:54 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 4/18/2014 1:44 AM, Paul Eggert wrote:
the MALLOC_0_IS_NONNULL macro attempting to check for
malloc(0) failure is not needed.
It's not needed for correctness, but it helps performance on GNU hosts, no? It lets them avoid an unnecessary test "size != 0" at runtime. The MALLOC_0_IS_NONNULL test is done at compile-time, and has no runtime overhead.
If saving that one test is worth the risk that MALLOC_0_IS_NONNULL will always be correctly be defined, e.g. that this will never always be true for all potential users:

+#ifdef _LIBC
+# define MALLOC_0_IS_NONNULL 1

uClibc defines it too:
libc-symbols.h:#define _LIBC    1

Nathan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]