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

Unified Diff: runtime/vm/benchmark_test.h

Issue 2711353003: Fixed tests not having MallocHooks initialized for tests in release mode. (Closed)
Patch Set: 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 | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/benchmark_test.h
diff --git a/runtime/vm/benchmark_test.h b/runtime/vm/benchmark_test.h
index edc9bfce882324b6f24ef8e469864b9491e765fc..d3569b04453ac57488efb28131a82c27beb2ef73 100644
--- a/runtime/vm/benchmark_test.h
+++ b/runtime/vm/benchmark_test.h
@@ -11,6 +11,7 @@
#include "vm/globals.h"
#include "vm/heap.h"
#include "vm/isolate.h"
+#include "vm/malloc_hooks.h"
#include "vm/object.h"
#include "vm/zone.h"
@@ -35,6 +36,9 @@ extern const uint8_t* core_isolate_snapshot_instructions;
static void Dart_BenchmarkHelper##name(Benchmark* benchmark, \
Thread* thread); \
void Dart_Benchmark##name(Benchmark* benchmark) { \
+ bool __stack_trace_collection_enabled__ = \
+ MallocHooks::stack_trace_collection_enabled(); \
+ MallocHooks::set_stack_trace_collection_enabled(false); \
FLAG_old_gen_growth_space_ratio = 100; \
BenchmarkIsolateScope __isolate__(benchmark); \
Thread* __thread__ = Thread::Current(); \
@@ -42,6 +46,8 @@ extern const uint8_t* core_isolate_snapshot_instructions;
StackZone __zone__(__thread__); \
HandleScope __hs__(__thread__); \
Dart_BenchmarkHelper##name(benchmark, __thread__); \
+ MallocHooks::set_stack_trace_collection_enabled( \
+ __stack_trace_collection_enabled__); \
} \
static void Dart_BenchmarkHelper##name(Benchmark* benchmark, Thread* thread)
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698