Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!umn-d-ub!umn-cs!thelake!steve From: steve@thelake.UUCP (Steve Yelvington) Newsgroups: comp.sys.atari.st Subject: Re: realloc() - standard unix opperation is what? Message-ID: <1114891351344765@thelake.UUCP> Date: 14 Dec 89 19:51:34 GMT References: <19281@watdragon.waterloo.edu> Reply-To: thelake!steve@umn-cs.cs.umn.edu Followup-To: comp.sys.atari.st Organization: Otter Lake Leisure Society (MN-USA) Lines: 32 X-Mailer: UUMAIL/Atari ST/TOS 1.0 X-Member-Of: STdNet, the ST Developers' Network X-Snail-Mail: 1392 Brandlwood, White Bear Lake, MN 55110 USA In article <19281@watdragon.waterloo.edu>, achowe@tiger.waterloo.edu (anthony howe) writes ... > >I'm making use of realloc() from the Dale's dlibs. However I wonder >how close this function is to a standard unix site. In Dale's version >if is NULL then a malloc is done. If is zero then a >free is done. Else resized and possibly moved block of memory. >NULL may be returned is the block can not be resized. > >Now the man page for realloc() here at U(W) does not say anything >except that the block is resized and possibly moved and that NULL >may be returned if the resize fails. > Dale's version is in accord with the interpretation of the draft ANSI standard described in "C: A Reference Manual," Harbison and Steele, Tartan Laboratories (Prentice-Hall), second edition. char *realloc(ptr,size) char *ptr; unsigned size; "If the first argument to realloc is a null pointer then the function behaves like malloc .... if ptr is not null and size is zero, realloc returns a null pointer and the old region is deallocated." I recommend the book. It's the "other C bible," along with K&R. -- Steve Yelvington at the (frozen enough to skate!) lake in Minnesota UUCP: ... pwcs.StPaul.GOV!stag!thelake!steve