diff options
author | Christopher Ferris <cferris@google.com> | 2017-08-04 13:04:04 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2017-09-05 15:57:00 -0700 |
commit | 602b88ccddfafdefec023e7599d49c811ad3214f (patch) | |
tree | 11730f3f0cbc308860c4e45d6f0310c7f2083041 /libc/malloc_debug/malloc_debug.h | |
parent | e0e2798f11ca082fe0a796f167f9006c51dc3304 (diff) |
Provide method to dump backtrace heap data.
For non-zygote spawned processes, we might want to dump the backtrace
data. Provide a method to send a signal to a process and then dump the
data to a file.
Adds a method to dump the backtrace data on exit.
Update documentation and explain format of heap dump data.
Test: Ran unit tests, enabled new options and used them.
Change-Id: Ie2fa706694160731afe02c1382b037d06df1d069
Diffstat (limited to 'libc/malloc_debug/malloc_debug.h')
-rw-r--r-- | libc/malloc_debug/malloc_debug.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/malloc_debug/malloc_debug.h b/libc/malloc_debug/malloc_debug.h index 347fae236..4a1e8dad1 100644 --- a/libc/malloc_debug/malloc_debug.h +++ b/libc/malloc_debug/malloc_debug.h @@ -54,7 +54,8 @@ struct Header { size_t size; size_t usable_size; size_t real_size() const { return size & ~(1U << 31); } - void set_zygote() { size |= 1U << 31; } + void set_zygote_child_alloc() { size |= 1U << 31; } + bool zygote_child_alloc() const { return size & (1U << 31); } static size_t max_size() { return (1U << 31) - 1; } } __attribute__((packed)); |