how do you know 'free' freed?

Mike Howard 213317-5690 howard at aic.dpl.scg.hac.com
Fri Oct 13 04:30:04 AEST 1989


I've malloc'd a tree structure, and then free'd it, node by node.
Of course, freeing it just marks it as free, and I can still walk
through the tree after freeing it.  I'd like to confirm that it is
in fact free.

I tried malloc'ing an array after freeing the tree, but I can't 
tell the array where to go in memory, so the tree still seems to
be there.  There must be some way to confirm free.

On my sun3 (Unix 4.3 BSD, SunOS 4.0.3) my malloc man page says ther
is a function called mallocmap() which will print out the heap, but
I can't seem to find it.

Does anyone have some advice on this?

Mike Howard



More information about the Comp.lang.c mailing list