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

Unified Diff: runtime/vm/malloc_hooks.cc

Issue 2771293003: Resubmission of native memory allocation info surfacing in Observatory. Fixed crashing tests and st… (Closed)
Patch Set: Removed garbage code, updated status file to skip service test not supported Created 3 years, 9 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
Index: runtime/vm/malloc_hooks.cc
diff --git a/runtime/vm/malloc_hooks.cc b/runtime/vm/malloc_hooks.cc
index 2721000616898ec0915be2bb81cd8c6b45758cd5..36ab5d8ea81f2f447fbd93b648dbf4d3c3dce317 100644
--- a/runtime/vm/malloc_hooks.cc
+++ b/runtime/vm/malloc_hooks.cc
@@ -161,7 +161,17 @@ class AllocationInfo {
// malloc_hook_tests.cc might fail, particularily
// StackTraceMallocHookLengthTest. If this value is updated, please make sure
// that the MallocHooks test cases pass on all platforms.
+#if defined(DEBUG) && defined(HOST_ARCH_X64)
static const intptr_t kSkipCount = 6;
+#elif defined(DEBUG) && defined(HOST_ARCH_IA32)
+ static const intptr_t kSkipCount = 5;
+#elif !(defined(PRODUCT) || defined(DEBUG)) && \
+ (defined(HOST_ARCH_X64) || defined(HOST_ARCH_IA32))
+ static const intptr_t kSkipCount = 5;
+#else
+#error Previously unsupported MallocHooks configuration. New kSkipCount may \
+ need to be added.
+#endif
siva 2017/03/24 22:51:00 Adding such target #ifs in a common file just make
bkonyi 2017/03/27 17:50:25 Done.
};
@@ -443,7 +453,8 @@ void MallocHooksState::RecordFreeHook(const void* ptr) {
if (MallocHooksState::address_map()->Lookup(ptr, &allocation_info)) {
MallocHooksState::DecrementHeapAllocatedMemoryInBytes(
allocation_info->allocation_size());
- ASSERT(MallocHooksState::address_map()->Remove(ptr));
+ bool result = MallocHooksState::address_map()->Remove(ptr);
+ ASSERT(result);
delete allocation_info;
}
}

Powered by Google App Engine
This is Rietveld 408576698