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:
parent
674e76845d
commit
97680106f0
@ -4,5 +4,6 @@ UsePrivateSystemHeaders ;
|
||||
UsePrivateHeaders libroot shared ;
|
||||
|
||||
MergeObject posix_malloc_debug.o :
|
||||
#guarded_heap.cpp
|
||||
heap.cpp
|
||||
;
|
||||
|
1004
src/system/libroot/posix/malloc_debug/guarded_heap.cpp
Normal file
1004
src/system/libroot/posix/malloc_debug/guarded_heap.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user