The free() thing and function names

Scott Amspoker scott at bbxsda.UUCP
Thu Sep 21 06:17:32 AEST 1989


In article <11117 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>
>A program can wrap the system-provided malloc()/realloc()/free() with
>its own bookkeeping module, if desired, but strict standard
>conformance (or maximal portability) requires that it not attempt to
>supplant malloc()/realloc()/free() with its own functions of the same
>name.

We have done something similar to what the original poster was talking
about.  We have had our own routines that our software calls to do
malloc() and free().  These routines normally just pass on the arguments
to the real malloc() and free().  However, in a debugging situation
these routines will keep track of malloc'ed and free'ed areas to help
figure out what it going on if pointers are being trashed.  But, no,
we don't call them malloc() and free().  Of course, now we're being
told that we're not allowed to do our own pointer checking.

-- 
Scott Amspoker
Basis International, Albuquerque, NM
(505) 345-5232



More information about the Comp.lang.c mailing list