Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!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: <946@skye.ed.ac.uk> Date: 27 Sep 89 16:50:44 GMT References: <902@skye.ed.ac.uk> <11117@smoke.BRL.MIL> Reply-To: richard@aiai.UUCP (Richard Tobin) Organization: AIAI, University of Edinburgh, Scotland Lines: 34 In article <11117@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <902@skye.ed.ac.uk> richard@aiai.UUCP (Richard Tobin) writes: >>This is a real pain for programs (like interpreters for other languages) >>that need to keep track of just what memory is in use. >Because a strictly conforming program cannot take cognizance of >implementation-specific details, they needn't be of concern. Many types of program can't be strictly conforming, but are nonetheless useful. The example I had in mind was the facility provided by many interactive languages for the dynamic loading of C (and other) code. Any reasonable Lisp or Prolog system will provide this (examples of its use are: re-using existing code written in another language, access to system calls and so forth, and critical procedures that cannot be written sufficiently efficiently in the host language). The code loaded in will often want to allocate memory, and the host language may need to know about this so that it can (for example) garbage collect safely. The user may not have access to the source of the loaded code (it might be a graphics library, for example), but if it only takes advantage of the advertised features of standard routines (such as malloc) then the host language can simulate them. Now, you may regard this as a hack, but it's certainly a useful hack, and it would be nice if there was a reliable way of doing it. -- 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