home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!nic.unh.edu!newshost.unh.edu!rg
- From: rg@msel.unh.edu (Roger Gonzalez)
- Subject: chasing memory leaks..
- Message-ID: <RG.92Jul22115123@nymph.msel.unh.edu>
- Sender: news@nic.unh.edu (USENET News System)
- Organization: UNH Marine Systems Engineering Lab
- Distribution: comp
- Date: Wed, 22 Jul 1992 16:51:23 GMT
- Lines: 21
-
-
- Is there a way to find out how much memory was allocated at a given address?
- I'd like to have a couple routines ("mymalloc" and "myfree") keep track of how
- much memory has been malloc'ed and free'ed in certain routines. Mymalloc is
- easy; just add the size to a leak tracking variable. Myfree needs to be able
- to look up the address being freed to find out how much to subtract from the
- tracking variable. I looked at mallinfo(), but I couldn't figure out how to
- get to where the address->size mapping is stored.
-
- Thanks,
- Roger
-
- --
- "The question of whether a computer can think is no more interesting
- than the question of whether a submarine can swim" - Edsger W. Dijkstra
-
- Roger Gonzalez - rg@msel.unh.edu
- Division of Bit Banging and Reluctant Robotics
- UNH Marine Systems Engineering Laboratory, Durham, NH 03824-3525
- (603) 862-4600 -4399 (fax)
-
-