From: Maoni Stephens Date: Thu, 18 Feb 2016 02:34:21 +0000 (-0800) Subject: port fix for pad ratio X-Git-Tag: accepted/tizen/base/20180629.140029~5559^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2db173a6b40b2a106443b00adbfd65c3aa2c0378;p=platform%2Fupstream%2Fcoreclr.git port fix for pad ratio [tfs-changeset: 1576135] --- diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 0d9e986..ca2cc94 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -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; diff --git a/src/gc/gcpriv.h b/src/gc/gcpriv.h index 1727a4c..d00c3b8 100644 --- a/src/gc/gcpriv.h +++ b/src/gc/gcpriv.h @@ -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