Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!purdue!decwrl!elroy.jpl.nasa.gov!sdd.hp.com!cs.utexas.edu!usc!apple!portal!cup.portal.com!Sullivan From: Sullivan@cup.portal.com (sullivan - segall) Newsgroups: comp.sys.amiga.tech Subject: Re: Manx-C and realloc() Message-ID: <28705@cup.portal.com> Date: 7 Apr 90 21:52:35 GMT References: <36252@dcatla.UUCP> <440@oregon.oacis.org> <3418@newton.physics.purdue.edu> Distribution: na Organization: The Portal System (TM) Lines: 38 > > >I am using Manx 3.6a, and had the need for realloc() the other >day. Unfortunately the linker couldn't find it, and neither could I! > >I am using 16 bit ints. realloc() doesn't seem to be in c.lib, or >heapmem.o. I seem to recall that this has been discussed several times >before in this group, but I don't remember the answer. > >Sorry for the duplication, but where is realloc()??? > >Nick >ng@maxwell.physics.purdue.edu Gag! I wrote: #define realloc(x) (free(x),malloc(x)) what I meant to write: #define realloc(x,s) (free(x),malloc(x,s)) This definition requires an ANSI compliant compiler. The comma operator (",") always returns its second argument as its value. Other than that this is good ANSI C, this is completely untested on Rev 5.0 of the Manx compiler. -Sullivan Segall _________________________________________________________________ /V\ Sullivan was the first to learn how to jump without moving. ' Is it not proper that the student should surpass the teacher? To Quote the immortal Socrates: "I drank what?" -Sullivan _________________________________________________________________ Mail to: ...sun!portal!cup.portal.com!Sullivan or Sullivan@cup.portal.com