diff options
author | Christopher Ferris <cferris@google.com> | 2016-04-20 12:30:58 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2016-07-08 14:05:17 -0700 |
commit | 7bd01783a830f72c1245c262a7fd9a199e90aed1 (patch) | |
tree | 5bd657e6c452d5f9d81a6c9b156ee748c8a8f070 /libc/malloc_debug/DebugData.cpp | |
parent | a0e205e3b4f7993affb864260e924ce9f20573d0 (diff) |
Add the record alloc option.
This option adds the ability to record all of the allocation requests
and dump them to a file when a signal is sent to the process.
Included in this change, redo the option processing to add a new
string option.
Bug: 27747898
Change-Id: Ida043362e38b5eb1d459c99db9c2581015dab366
Diffstat (limited to 'libc/malloc_debug/DebugData.cpp')
-rw-r--r-- | libc/malloc_debug/DebugData.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/malloc_debug/DebugData.cpp b/libc/malloc_debug/DebugData.cpp index 58cbbcb47..fdc28100f 100644 --- a/libc/malloc_debug/DebugData.cpp +++ b/libc/malloc_debug/DebugData.cpp @@ -77,6 +77,13 @@ bool DebugData::Initialize() { } } + if (config_.options & RECORD_ALLOCS) { + record.reset(new RecordData()); + if (!record->Initialize(config_)) { + return false; + } + } + if (config_.options & EXPAND_ALLOC) { extra_bytes_ += config_.expand_alloc_bytes; } |