Chromium Code Reviews| Index: runtime/vm/pages.cc |
| diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc |
| index 6d959cda750bbb4a5311767f88289a3669522e83..930727aeab7724dec12e7e89f8dca71c3abde2e6 100644 |
| --- a/runtime/vm/pages.cc |
| +++ b/runtime/vm/pages.cc |
| @@ -5,6 +5,7 @@ |
| #include "vm/pages.h" |
| #include "platform/assert.h" |
| +#include "platform/address_sanitizer.h" |
|
zra
2017/01/23 16:58:58
DBC: alphabetize.
|
| #include "vm/compiler_stats.h" |
| #include "vm/gc_marker.h" |
| #include "vm/gc_sweeper.h" |
| @@ -69,6 +70,10 @@ HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) { |
| result->memory_ = memory; |
| result->next_ = NULL; |
| result->type_ = type; |
| + |
| + LSAN_REGISTER_ROOT_REGION(memory->address(), |
| + static_cast<size_t>(memory->size())); |
| + |
| return result; |
| } |
| @@ -89,6 +94,9 @@ HeapPage* HeapPage::Allocate(intptr_t size_in_words, PageType type) { |
| void HeapPage::Deallocate() { |
| + LSAN_UNREGISTER_ROOT_REGION(memory_->address(), |
| + static_cast<size_t>(memory_->size())); |
| + |
| // The memory for this object will become unavailable after the delete below. |
| delete memory_; |
| } |