Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ucsd!chem.ucsd.edu!tps From: tps@chem.ucsd.edu (Tom Stockfisch) Newsgroups: comp.lang.c Subject: Re: Tracking memory leaks.. Message-ID: <288@chem.ucsd.EDU> Date: 10 Sep 88 19:04:25 GMT References: <3950011@eecs.nwu.edu> <164@amsdsg.UUCP> Reply-To: tps@chem.ucsd.edu (Tom Stockfisch) Organization: Chemistry Dept, UC San Diego Lines: 13 In article <164@amsdsg.UUCP> jeff@amsdsg.UUCP (Jeff Barr) writes: >In article <3950011@eecs.nwu.edu>, naim@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@chem.ucsd.edu