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

Unified Diff: src/platform-linux.cc

Issue 137313002: Annotate mapped memory regions for LeakSanitizer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-linux.cc
===================================================================
--- src/platform-linux.cc (revision 18572)
+++ src/platform-linux.cc (working copy)
@@ -57,6 +57,10 @@
#include <asm/sigcontext.h>
#endif
+#if defined(LEAK_SANITIZER)
+#include <sanitizer/lsan_interface.h>
+#endif
+
#undef MAP_TYPE
#include "v8.h"
@@ -348,6 +352,9 @@
address_ = static_cast<void*>(aligned_base);
size_ = aligned_size;
+#if defined(LEAK_SANITIZER)
+ __lsan_register_root_region(address_, size_);
+#endif
}
@@ -397,6 +404,9 @@
if (result == MAP_FAILED) return NULL;
+#if defined(LEAK_SANITIZER)
+ __lsan_register_root_region(result, size);
+#endif
return result;
}
@@ -433,6 +443,9 @@
bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
+#if defined(LEAK_SANITIZER)
+ __lsan_unregister_root_region(base, size);
+#endif
return munmap(base, size) == 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698