port fix for pad ratio
authorMaoni Stephens <maonis@microsoft.com>
Thu, 18 Feb 2016 02:34:21 +0000 (18:34 -0800)
committerMaoni Stephens <maonis@microsoft.com>
Thu, 18 Feb 2016 02:34:21 +0000 (18:34 -0800)
[tfs-changeset: 1576135]

src/gc/gc.cpp
src/gc/gcpriv.h

index 0d9e986..ca2cc94 100644 (file)
@@ -2278,7 +2278,7 @@ size_t      gc_heap::gc_last_ephemeral_decommit_time = 0;
 size_t      gc_heap::gc_gen0_desired_high;
 
 #ifdef SHORT_PLUGS
-float       gc_heap::short_plugs_pad_ratio = 0;
+double       gc_heap::short_plugs_pad_ratio = 0;
 #endif //SHORT_PLUGS
 
 #if defined(BIT64)
@@ -4361,8 +4361,8 @@ gc_heap::compute_new_ephemeral_size()
 #endif //RESPECT_LARGE_ALIGNMENT
 
 #ifdef SHORT_PLUGS
-    total_ephemeral_size = Align ((size_t)((float)total_ephemeral_size * short_plugs_pad_ratio) + 1);
-    total_ephemeral_size += Align (min_obj_size);
+    total_ephemeral_size = Align ((size_t)((double)total_ephemeral_size * short_plugs_pad_ratio) + 1);
+    total_ephemeral_size += Align (DESIRED_PLUG_LENGTH);
 #endif //SHORT_PLUGS
 
     dprintf (3, ("total ephemeral size is %Ix, padding %Ix(%Ix)", 
@@ -9837,10 +9837,7 @@ gc_heap::init_semi_shared()
 #endif //GC_CONFIG_DRIVEN
 
 #ifdef SHORT_PLUGS
-    {
-        size_t max_num_objects_in_plug = (size_t)DESIRED_PLUG_LENGTH / Align(min_obj_size);
-        short_plugs_pad_ratio = (float)(max_num_objects_in_plug + 1) / (float)max_num_objects_in_plug;
-    }
+    short_plugs_pad_ratio = (double)DESIRED_PLUG_LENGTH / (double)(DESIRED_PLUG_LENGTH - Align (min_obj_size));
 #endif //SHORT_PLUGS
 
     ret = 1;
index 1727a4c..d00c3b8 100644 (file)
@@ -2922,7 +2922,7 @@ public:
 
 #ifdef SHORT_PLUGS
     PER_HEAP_ISOLATED
-    float short_plugs_pad_ratio;
+    double short_plugs_pad_ratio;
 #endif //SHORT_PLUGS
 
 #ifdef BIT64