Debug new

Debug new

Debug_new refers to a technique in C++ to overload and/or redefine operator new and operator delete in order to intercept the memory allocation and deallocation calls, and thus debug a program for memory usage. It often involves defining a macro named DEBUG_NEW, and makes new become something like new(__FILE__, __LINE__) to record the file/line information on allocation. Microsoft Visual C++ uses this technique in its Microsoft Foundation Classes. There are some ways to extend this method to avoid using macro redefinition while still able to display the file/line information on some platforms.

There are many inherent limitations to this method. It applies only to C++, and cannot catch memory leaks by C functions like malloc. However, it can be very simple to use and also very fast, when compared to some more complete memory debugger solutions.

ee also

*Memory debugger

External links

* [http://wyw.dcweb.cn/leakage.htm A Cross-Platform Memory Leak Detector]
* [http://msdn2.microsoft.com/en-us/library/tz7sxz99(VS.80).aspx DEBUG_NEW (MFC)]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Debug (magazine) — De:Bug is a monthly magazine based in Berlin, covering electronic aspects of life. Following this new definition of culture, the magazine keeps track of electronic music styles such as techno, electro or house, as well as all intersections of… …   Wikipedia

  • X86 debug register — Debug register is a register used by a processor for program debugging. On the x86 architecture, these are named DR0...DR7. The debug registers allow programmers to selectively enable various debug conditions associated with the four debug… …   Wikipedia

  • True Crime: New York City — North American cover art Developer(s) Luxoflux Publisher(s) Activision …   Wikipedia

  • Background Debug Mode interface — Background Debug Mode (BDM) interface is an electronic interface that allows debugging of embedded systems. Specifically, it provides in circuit debugging functionality in microcontrollers. It requires a single wire and specialized electronics in …   Wikipedia

  • x86 debug register — On the x86 architecture, a debug register is a register used by a processor for program debugging. There are six debug registers, named DR0...DR7, with DR4 and DR5 as obsolete synonyms for DR6 and DR7. The debug registers allow programmers to… …   Wikipedia

  • Management features new to Windows Vista — This article is part of a series on Windows Vista New features Overview Technical and core system Security and safety Networking technologies I/O technologies Management and administration Removed features …   Wikipedia

  • List of mammals in Papua New Guinea — This is a list of the mammal species recorded in Papua New Guinea. There are 242 mammal species in Papua New Guinea, of which 7 are critically endangered, 12 are endangered, 39 are vulnerable, and 0 are near threatened. [This list is derived from …   Wikipedia

  • List of mammals in New Zealand — This is a list of the mammal species recorded in New Zealand. Prior to human settlement New Zealand only had three land based mammals and a number of marine mammals. A number of mammals were brought to New Zealand by the Māori and European… …   Wikipedia

  • The Soul of a New Machine — Infobox Book name = The Soul of a New Machine image caption = author = Tracy Kidder cover artist = country = United States subject = Electrical engineering, Electronics publisher = Little, Brown and Company pub date = July 1981 media type =… …   Wikipedia

  • List of mammals in New Caledonia — This is a list of the mammal species recorded in New Caledonia. There are 16 mammal species in New Caledonia, of which 0 are critically endangered, 2 are endangered, 4 are vulnerable, and 0 are near threatened. 1 of the species listed for New… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”