Bug 913376 - Use double in ComputeTriggerBytes. (r=terrence)
authorShu-yu Guo <shu@rfrn.org>
Tue, 15 Oct 2013 18:41:54 -0700
changeset 150857 349d02055f07ceaea5b2dfdf81be5b8b8a4de595
parent 150856 d1881913d9a676f2a6ef45a6da3bf20c0f33c8f6
child 150858 da7c23b2d1c7e3bd07eba75d2c088a9fa9369789
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersterrence
bugs913376
milestone27.0a1
Bug 913376 - Use double in ComputeTriggerBytes. (r=terrence)
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1117,18 +1117,18 @@ js_RemoveRoot(JSRuntime *rt, void *rp)
 typedef RootedValueMap::Range RootRange;
 typedef RootedValueMap::Entry RootEntry;
 typedef RootedValueMap::Enum RootEnum;
 
 static size_t
 ComputeTriggerBytes(Zone *zone, size_t lastBytes, size_t maxBytes, JSGCInvocationKind gckind)
 {
     size_t base = gckind == GC_SHRINK ? lastBytes : Max(lastBytes, zone->runtimeFromMainThread()->gcAllocationThreshold);
-    float trigger = float(base) * zone->gcHeapGrowthFactor;
-    return size_t(Min(float(maxBytes), trigger));
+    double trigger = double(base) * zone->gcHeapGrowthFactor;
+    return size_t(Min(double(maxBytes), trigger));
 }
 
 void
 Zone::setGCLastBytes(size_t lastBytes, JSGCInvocationKind gckind)
 {
     /*
      * The heap growth factor depends on the heap size after a GC and the GC frequency.
      * For low frequency GCs (more than 1sec between GCs) we let the heap grow to 150%.