home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9290 < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.2 KB  |  33 lines

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