Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1234)

Unified Diff: runtime/vm/pages.cc

Issue 2646363005: VM: Tell lsan about mmap()ed regions used for our heap (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/platform/address_sanitizer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
}
« no previous file with comments | « runtime/platform/address_sanitizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698