🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5780

Re: realloc

#5780
From: Larry Jones
Date: Wed, 29 Mar 1989 22:02
17 lines
1358 bytes
In article <10170@bloom-beacon.MIT.EDU>, scs@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@sdrc.UU.NET
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"When all else fails, read the directions."
Technical Details
Message-ID: <681@sdrc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ncis.llnl.gov!lll-winken!uunet!sdrc!scjones
References: <10170@bloom-beacon.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ncis.llnl.gov!lll-winken!uunet!sdrc!scjones
From: scjones@sdrc.UUCP (Larry Jones)
Newsgroups: comp.std.c,comp.lang.c
Subject: Re: realloc
Summary: Required by ANSI
Keywords: realloc NULL
Message-ID: <681@sdrc.UUCP>
Date: 29 Mar 89 22:02:25 GMT
References: <10170@bloom-beacon.MIT.EDU>
Organization: Structural Dynamics Research Corp., Cincinnati
Lines: 17