The free() thing and function names

Richard Tobin richard at aiai.ed.ac.uk
Thu Sep 28 02:50:44 AEST 1989


In article <11117 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <902 at skye.ed.ac.uk> richard at 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 at uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed at nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.lang.c mailing list