Make UseTLAB a bool flag.
This would make it easier to override its default value at build time.
Change-Id: I643fe1afaf492f0443dc01df0c9a62bb3fa025d9
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index a5df892..daa4373 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -141,6 +141,7 @@
.Define("-XX:LowMemoryMode")
.IntoKey(M::LowMemoryMode)
.Define("-XX:UseTLAB")
+ .WithValue(true)
.IntoKey(M::UseTLAB)
.Define({"-XX:EnableHSpaceCompactForOOM", "-XX:DisableHSpaceCompactForOOM"})
.WithValues({true, false})
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index c6e858b..0ccc97c 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -787,7 +787,7 @@
runtime_options.GetOrDefault(Opt::LongPauseLogThreshold),
runtime_options.GetOrDefault(Opt::LongGCLogThreshold),
runtime_options.Exists(Opt::IgnoreMaxFootprint),
- runtime_options.Exists(Opt::UseTLAB),
+ runtime_options.GetOrDefault(Opt::UseTLAB),
xgc_option.verify_pre_gc_heap_,
xgc_option.verify_pre_sweeping_heap_,
xgc_option.verify_post_gc_heap_,
diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def
index 022a2a5..1bdc980 100644
--- a/runtime/runtime_options.def
+++ b/runtime/runtime_options.def
@@ -61,7 +61,7 @@
RUNTIME_OPTIONS_KEY (Unit, DumpGCPerformanceOnShutdown)
RUNTIME_OPTIONS_KEY (Unit, IgnoreMaxFootprint)
RUNTIME_OPTIONS_KEY (Unit, LowMemoryMode)
-RUNTIME_OPTIONS_KEY (Unit, UseTLAB)
+RUNTIME_OPTIONS_KEY (bool, UseTLAB, false)
RUNTIME_OPTIONS_KEY (bool, EnableHSpaceCompactForOOM, true)
RUNTIME_OPTIONS_KEY (MillisecondsToNanoseconds, \
HSpaceCompactForOOMMinIntervalsMs,\