잠토의 잠망경

[Code Project]Heap Memory Manager and Garbage Collector 본문

공부/Cpp

[Code Project]Heap Memory Manager and Garbage Collector

잠수함토끼 2008. 7. 3. 13:24

Introduction

This article demonstrates a method to try and solve a common problem hated by most C++ programmers: memory leaks and memory overruns. The method used in this article is to track all memory allocated by the program. It also has basic protection checks whether the memory written to the allocated block has overrun the number of bytes actually allocated.

This method also lets you organize and group allocated memory by ID or by name. Giving a name to a memory allocation gives the advantage that you can get the memory allocated by name while not needing to keep a pointer running around. Giving a group ID to an allocation helps the programmer to keep memory allocations grouped and thus can call a single function to deallocate all memory of a certain group.

출처: http://www.codeproject.com/KB/cpp/HeapMemTracker.aspx
Comments