瀏覽代碼

added good fit percentage as environmental variable option

Ioannis Koutras 11 年之前
父節點
當前提交
cf53b46fe4
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      src/parse_env.c

+ 12 - 0
src/parse_env.c

@@ -67,6 +67,18 @@ void parse_env(void) {
     }
 #endif /* WITH_DEBUG */
 
+#if defined WITH_KNOBS && defined GOOD_FIT
+    env = getenv("DMMLIB_GOOD_FIT");
+
+    if(env != NULL) {
+        char *end;
+        double good_fit_perc = strtod(env, &end);
+        if(good_fit_perc != 0) {
+            systemallocator.dmm_knobs.fit_percentage = good_fit_perc;
+        }
+    }
+#endif /* WITH_KNOBS && GOOD_FIT */
+
     env = getenv("DMMLIB_SYSALLOC_SZ");
 
     if(env != NULL) {