char[MAX_OPT_LEN] collect_stats_file = "";
bool sentinel = false;
bool mem_stomp = false;
- bool conservative = false;
+ version (D_HavePointerMap)
+ bool conservative = false;
+ else
+ bool conservative = true;
bool fork = true;
bool eager_alloc = true;
+ bool early_collect = false;
uint min_free = 5; // percent of the heap (0-100)
size_t prealloc_psize = 0;
size_t prealloc_npools = 0;
options.fork = parse_bool(opt_value);
else if (cstr_eq(opt_name, "eager_alloc"))
options.eager_alloc = parse_bool(opt_value);
+ else if (cstr_eq(opt_name, "early_collect"))
+ options.early_collect = parse_bool(opt_value);
else if (cstr_eq(opt_name, "min_free"))
parse_min_free(opt_value);
else if (cstr_eq(opt_name, "pre_alloc"))
assert (conservative == false);
assert (fork == true);
assert (eager_alloc == true);
+ assert (early_collect == false);
assert (prealloc_psize == 0);
assert (prealloc_npools == 0);
assert (min_free == 5);
assert (conservative == false);
assert (fork == true);
assert (eager_alloc == true);
+ assert (early_collect == false);
assert (prealloc_psize == 0);
assert (prealloc_npools == 0);
assert (min_free == 5);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 0);
assert (prealloc_npools == 0);
assert (min_free == 5);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 0);
assert (prealloc_npools == 0);
assert (min_free == 5);
}
- parse("pre_alloc:min_free=30");
+ parse("pre_alloc:min_free=30:early_collect");
with (options) {
assert (verbose == 1);
assert (cstring.strcmp(log_file.ptr, "12345 67890".ptr) == 0);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == true);
assert (prealloc_psize == 0);
assert (prealloc_npools == 0);
assert (min_free == 30);
}
- parse("pre_alloc=1");
+ parse("pre_alloc=1:early_collect=0");
with (options) {
assert (verbose == 1);
assert (cstring.strcmp(log_file.ptr, "12345 67890".ptr) == 0);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 1 * 1024 * 1024);
assert (prealloc_npools == 1);
assert (min_free == 30);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 1 * 1024 * 1024);
assert (prealloc_npools == 1);
assert (min_free == 30);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 1 * 1024 * 1024);
assert (prealloc_npools == 1);
assert (min_free == 30);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 9 * 1024 * 1024);
assert (prealloc_npools == 10);
assert (min_free == 30);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 30);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 30);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 0);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 100);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 100);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 100);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 100);
assert (conservative == true);
assert (fork == false);
assert (eager_alloc == false);
+ assert (early_collect == false);
assert (prealloc_psize == 5 * 1024 * 1024);
assert (prealloc_npools == 2);
assert (min_free == 100);