This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: x*alloc optimizations


Michael Meissner <meissner@cygnus.com> writes:

> There are loads of uncomplaint systems.

Agreed, and this is what Jim's macros are testing for.  I commented on
your comment that relying on realloc(NULL,size) is unsafe since some
vendor might change the behaviour.

> Also ISO C has two different behaviors (return NULL or return a
> unique pointer).  If you test for one, a system vendor may change
> his/her implementation to do the other behavior without breaking ISO
> C conformance.

But this isn't what we are testing for.  This is uninteresting here.
All the macros do is to test whether

	realloc(NULL, size) == malloc(size)

as demanded by ISO C and the "worst" which could happen is that one
more vendors sees the light and changes the non-ISO C behaviour.

-- Uli
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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