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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2625613002: Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… (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/assert.h ('k') | runtime/vm/malloc_hooks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 8ff2deb5d67f79af18fbb3ae1cc7074d99718e6e..dca2d0111504c7c1d3629f78af8a7eb10f5450a8 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -26,6 +26,7 @@
#include "vm/lockers.h"
#include "vm/isolate_reload.h"
#include "vm/kernel_isolate.h"
+#include "vm/malloc_hooks.h"
#include "vm/message.h"
#include "vm/message_handler.h"
#include "vm/native_entry.h"
@@ -1172,6 +1173,8 @@ DART_EXPORT char* Dart_Initialize(Dart_InitializeParams* params) {
"Invalid Dart_InitializeParams version.");
}
+ MallocHooks::Init();
+
return Dart::InitOnce(params->vm_isolate_snapshot,
params->instructions_snapshot, params->data_snapshot,
params->create, params->shutdown, params->thread_exit,
@@ -1184,6 +1187,7 @@ DART_EXPORT char* Dart_Initialize(Dart_InitializeParams* params) {
DART_EXPORT char* Dart_Cleanup() {
CHECK_NO_ISOLATE(Isolate::Current());
const char* err_msg = Dart::Cleanup();
+ MallocHooks::TearDown();
if (err_msg != NULL) {
return strdup(err_msg);
}
« no previous file with comments | « runtime/platform/assert.h ('k') | runtime/vm/malloc_hooks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698