Adding two debug features to the new heap implementation:

* Tracing of allocations, reallocations and frees
* Leak checking infrastructure to dump allocations

The leak checking code records the team and thread id when an allocation is
made as well as stores the originally requested size. It also adds the
"allocations" debugger command that can dump all current allocations (usually
a huge list) or filter by either a team or thread id. This way it's easily
possible to find leftover allocations of no more active teams/threads.
Combined with the tracing support one might be able to track down the time and
reason of an allocation and possibly find the corresponding leak if it is one.
Note that kernel heap leak checking has to be enabled manually by setting the
KERNEL_HEAP_LEAK_CHECK define to 1.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23953 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-02-12 20:20:35 +00:00
parent d9b0e6addd
commit 4af6cd5f38
2 changed files with 254 additions and 3 deletions
+1
View File
@@ -18,6 +18,7 @@
//#define BMESSAGE_TRACING
//#define BLOCK_CACHE_TRANSACTION_TRACING
//#define KERNEL_HEAP_TRACING
//#define RUNTIME_LOADER_TRACING
//#define SIGNAL_TRACING
//#define SYSCALL_TRACING