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

Unified Diff: runtime/vm/pages.cc

Issue 2646363005: VM: Tell lsan about mmap()ed regions used for our heap (Closed)
Patch Set: Mark Dart2JSCompilerStats/Dart2JSCompileAll as Crash, Fail 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/tests/vm/vm.status ('k') | tests/standalone/standalone.status » ('j') | 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 c8f24daf5f0bcbf35b30aa2bc6310aff38b504eb..287d4cf6a4e683f059cdc5feca5ec7f59ced20aa 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -4,6 +4,7 @@
#include "vm/pages.h"
+#include "platform/address_sanitizer.h"
#include "platform/assert.h"
#include "vm/compiler_stats.h"
#include "vm/gc_marker.h"
@@ -69,6 +70,9 @@ HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) {
result->memory_ = memory;
result->next_ = NULL;
result->type_ = type;
+
+ LSAN_REGISTER_ROOT_REGION(result, sizeof(*result));
+
return result;
}
@@ -89,9 +93,14 @@ HeapPage* HeapPage::Allocate(intptr_t size_in_words, PageType type) {
void HeapPage::Deallocate() {
+ bool is_embedder_allocated = embedder_allocated();
+
+ if (!is_embedder_allocated) {
+ LSAN_UNREGISTER_ROOT_REGION(this, sizeof(*this));
+ }
+
// For a regular heap pages, the memory for this object will become
// unavailable after the delete below.
- bool is_embedder_allocated = embedder_allocated();
delete memory_;
// For a heap page from a snapshot, the HeapPage object lives in the malloc
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698