Add a userland version of the guarded heap to libroot_debug.

The guarded heap uses mprotect() to protect freed/unallocated pages so
that any access to such a page results in a segfault. It also installs
a segfault handler that in such an event prints some info about the
accessed page and then calls the debugger with a meaningful message.

It implements the same interface as the debug heap so it can simply be
swapped out by changing the Jamfile. As it doesn't support most of the
extra debug features (wall checking is obviously superfluous, but it
also doesn't help in leak checking) and as it is hugely space
inefficient I left it disabled for now.
This commit is contained in:
Michael Lotz 2011-12-07 00:40:47 +01:00
parent 674e76845d
commit 97680106f0
2 changed files with 1005 additions and 0 deletions

View File

@ -4,5 +4,6 @@ UsePrivateSystemHeaders ;
UsePrivateHeaders libroot shared ; UsePrivateHeaders libroot shared ;
MergeObject posix_malloc_debug.o : MergeObject posix_malloc_debug.o :
#guarded_heap.cpp
heap.cpp heap.cpp
; ;

File diff suppressed because it is too large Load Diff