Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!ukc!edcastle!aiai!richard From: richard@aiai.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c Subject: Re: The free() thing and function names Message-ID: <902@skye.ed.ac.uk> Date: 19 Sep 89 15:26:17 GMT References: <1989Sep14.022055.5961@twwells.com> <841@uniol.UUCP> <11073@smoke.BRL.MIL> Reply-To: richard@aiai.UUCP (Richard Tobin) Organization: AIAI, University of Edinburgh, Scotland Lines: 30 In article <11073@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <841@uniol.UUCP> lehners@uniol.UUCP (Joerg Lehners) writes: >>Don't hardcode any (even standard) functions into the compiler. >>What about writing my own free() function, possibly with a completly >>different semantic ? > >You absolutely must NOT do that in a hosted implementation. Several >library routines may depend, not only on the documented semantics of >an external function named free(), but also on implementation-specific >internal properties of the free() implementation. This is a real pain for programs (like interpreters for other languages) that need to keep track of just what memory is in use. A helpful implementation would at least provide a way of producing code that relied only on the advertised semantics of malloc(), etc, perhaps by means of a compiler flag. [Incidentally, if Joerg Lehners really wants "completely different" semantics for free - rather than just say keeping a note of whats been freed in addition to freeing the block - then he's going to lose!] I hope that this will be treated as a "quality of implementation" issue. -- Richard -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin