home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool.mu.edu!agate!stanford.edu!kronos.arc.nasa.gov!butch!netcomsv!netcom.com!erc
- From: erc@netcom.com (Eric Smith)
- Subject: Re: Dangling pointers & suggestions on future implementations of "delete"
- Message-ID: <1993Jan21.083428.10058@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <Jan18.210305.21697@yuma.ACNS.ColoState.EDU> <1993Jan19.193048.15022@borland.com> <1993Jan20.213807.20740@cbnewsi.cb.att.com>
- Date: Thu, 21 Jan 1993 08:34:28 GMT
- Lines: 13
-
- In article <1993Jan20.213807.20740@cbnewsi.cb.att.com> rhw@att.com (Robert Wentworth) writes:
- >Anyone else have nifty techniques that they use to root out memory
- >problems?
-
- My memory allocation function keeps track of the amount of memory it has
- allocated and the amount it has freed. When the program exits normally,
- it verifies that the amount of memory freed equals the amount allocated,
- and issues a warning if not. I have this feature turned on at all times
- during development, not just for debugging memory allocation problems.
- So if I add a new feature that happens to have a memory leak in it, I find
- out right away, even if it has been months or years since my last memory
- leak. And the cost is insignificant, such that it wouldn't hurt even if
- I left it turned on in a delivered application.
-