realloc
Larry Jones
scjones at sdrc.UUCP
Thu Mar 30 08:02:25 AEST 1989
In article <10170 at bloom-beacon.MIT.EDU>, scs at adam.pika.mit.edu (Steve Summit) writes:
> Today, for the third time in half as many years, I got badly
> burned, and wasted lots of time, due to a bug in a certain
> vendor's implementation of realloc. It is an apparently well-
> kept secret that realloc is supposed to behave gracefully at
> a slightly special-cased boundary point: when handed a NULL
> pointer and a nonzero size, it acts essentially as a malloc.
And when handed a non-NULL pointer and a zero size, it acts like
free. This behavior is required by the draft ANSI Standard.
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC scjones at sdrc.UU.NET
2000 Eastman Dr. BIX: ltl
Milford, OH 45150 AT&T: (513) 576-2070
"When all else fails, read the directions."
More information about the Comp.lang.c
mailing list