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

Unified Diff: runtime/vm/malloc_hooks_test.cc

Issue 2700033003: Disabled MallocHooks code in Release due to performance concerns. Added enable_malloc_hooks flag to… (Closed)
Patch Set: Disabled MallocHooks code in Release due to performance concerns. Added enable_malloc_hooks flag to… Created 3 years, 10 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/vm/malloc_hooks.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/malloc_hooks_test.cc
diff --git a/runtime/vm/malloc_hooks_test.cc b/runtime/vm/malloc_hooks_test.cc
index 5054a5047dd0f09c6f4de145c68b79e9b8676740..791e2694aa9deff839b4454d2137c52575820a64 100644
--- a/runtime/vm/malloc_hooks_test.cc
+++ b/runtime/vm/malloc_hooks_test.cc
@@ -26,6 +26,9 @@ static void MallocHookTestBufferInitializer(volatile char* buffer,
UNIT_TEST_CASE(BasicMallocHookTest) {
+ bool enable_malloc_hooks_saved = FLAG_enable_malloc_hooks;
+ FLAG_enable_malloc_hooks = true;
+
MallocHooks::InitOnce();
MallocHooks::ResetStats();
EXPECT_EQ(0L, MallocHooks::allocation_count());
@@ -42,10 +45,15 @@ UNIT_TEST_CASE(BasicMallocHookTest) {
EXPECT_EQ(0L, MallocHooks::allocation_count());
EXPECT_EQ(0L, MallocHooks::heap_allocated_memory_in_bytes());
MallocHooks::TearDown();
+
+ FLAG_enable_malloc_hooks = enable_malloc_hooks_saved;
}
UNIT_TEST_CASE(FreeUnseenMemoryMallocHookTest) {
+ bool enable_malloc_hooks_saved = FLAG_enable_malloc_hooks;
+ FLAG_enable_malloc_hooks = true;
+
MallocHooks::InitOnce();
const intptr_t pre_hook_buffer_size = 3;
char* pre_hook_buffer = new char[pre_hook_buffer_size];
@@ -73,6 +81,8 @@ UNIT_TEST_CASE(FreeUnseenMemoryMallocHookTest) {
EXPECT_EQ(0L, MallocHooks::allocation_count());
EXPECT_EQ(0L, MallocHooks::heap_allocated_memory_in_bytes());
MallocHooks::TearDown();
+
+ FLAG_enable_malloc_hooks = enable_malloc_hooks_saved;
}
}; // namespace dart
« no previous file with comments | « runtime/vm/malloc_hooks.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698