This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: x*alloc optimizations
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: x*alloc optimizations
- From: Ulrich Drepper <drepper at cygnus dot com>
- Date: 20 May 1998 12:48:40 -0700
- Cc: egcs at cygnus dot com
- References: <199805201944.PAA10337@tiktok.cygnus.com>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
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 `------------------------