Tracking memory leaks..

Tom Stockfisch tps at chem.ucsd.edu
Sun Sep 11 05:04:25 AEST 1988


In article <164 at amsdsg.UUCP> jeff at amsdsg.UUCP (Jeff Barr) writes:
>In article <3950011 at eecs.nwu.edu>, naim at eecs.nwu.edu (Naim Abdullah) writes:
>> I want to check sections of a big program for memory leaks....

>You can allocate space for an extra 'int' in xmalloc, store the size
>yourself at the beginning of the allocated block (being sure to return a
>pointer PAST the 'int'), and then retrieve it in xfree.

This assumes that "int" has the most stringent alignment requirements.
Doesn't draft-ANS have a MAXALIGN_T or something like that?
-- 

|| Tom Stockfisch, UCSD Chemistry	tps at chem.ucsd.edu



More information about the Comp.lang.c mailing list