TurboC malloc() question

sac90286 at uxa.cso.uiuc.edu sac90286 at uxa.cso.uiuc.edu
Wed Sep 20 00:39:00 AEST 1989


Hello Netland!
I'm trying to make use of some dynamic memory allocation debugging 
routines I found in Byte magazine (I don't remember exactly which
issue, though). The code does some basic integrity checks of the 
free list at each call to malloc(), realloc() or free(). It relies on
some "inside knowledge" of the way the memory allocation routines are
implemented, specifically the structure of each node in the free list
and the symbol pointing to the head of the free list. The symbol they
give as the free list head pointer, _allocp, is apparently not the name
Borland uses in their malloc implementation (at least under version 2.0).

I poked around a bit and stumbled across a symbol called __first, but when
I substituted that symbol for _allocp the memory check routines crashed
immediately. Either my guess was wrong and __first isn't the pointer I need
or the node structure given in the article is different from that used by
TC. 

Can some kind soul provide me with the structure declaration as well as
the name of the free list head pointer? I'd be most appreciative.

Scott
kubla at uiuc.edu



More information about the Comp.lang.c mailing list