From 55a93d1838a42f50d2334a65247a887fe31f0e4c Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 25 May 2021 02:20:32 +0300 Subject: [PATCH] fix -M --- src/h.h | 2 +- src/load.c | 4 +++- src/opt/mm_2buddy.c | 3 --- src/opt/mm_buddy.c | 3 --- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/h.h b/src/h.h index 9eb92854..4fdbace5 100644 --- a/src/h.h +++ b/src/h.h @@ -21,7 +21,7 @@ #define SFNS_FILLS true // whether to insert fills for structural functions (∾, ≍, etc) #define FAKE_RUNTIME false // whether to disable the self-hosted runtime #define MM 1 // memory manager; 0 - malloc (no GC); 1 - buddy; 2 - 2buddy -#define HEAP_MAX 1ULL<<48 // default heap max size +#define HEAP_MAX ~0ULL // default heap max size // #define LOG_GC // log GC stats // #define FORMATTER // use self-hosted formatter for output diff --git a/src/load.c b/src/load.c index 7ac26b36..c089ce44 100644 --- a/src/load.c +++ b/src/load.c @@ -2,6 +2,9 @@ #include "vm.h" #include "utils/file.h" +u64 mm_heapMax = HEAP_MAX; +u64 mm_heapAlloc; + #define FA(N,X) B bi_##N; B N##_c1(B t, B x); B N##_c2(B t, B w, B x); #define FM(N,X) B bi_##N; B N##_c1(B t, B x); #define FD(N,X) B bi_##N; B N##_c2(B t, B w, B x); @@ -241,7 +244,6 @@ static B def_m2_d(B m, B f, B g) { thrM("cannot derive this"); } static B def_slice(B x, usz s) { thrM("cannot slice non-array!"); } static inline void base_init() { // very first init function - mm_heapMax = HEAP_MAX; for (i32 i = 0; i < t_COUNT; i++) { ti[i].free = def_free; ti[i].visit = def_visit; diff --git a/src/opt/mm_2buddy.c b/src/opt/mm_2buddy.c index 4df7b7ee..9567d5cc 100644 --- a/src/opt/mm_2buddy.c +++ b/src/opt/mm_2buddy.c @@ -4,9 +4,6 @@ u64 currObjCounter; #endif -u64 mm_heapAlloc; -u64 mm_heapMax; - EmptyValue* b1_buckets[64]; b1_AllocInfo* b1_al; u64 b1_alCap; diff --git a/src/opt/mm_buddy.c b/src/opt/mm_buddy.c index e8e4dbbe..d31e493f 100644 --- a/src/opt/mm_buddy.c +++ b/src/opt/mm_buddy.c @@ -4,9 +4,6 @@ u64 currObjCounter; #endif -u64 mm_heapAlloc; -u64 mm_heapMax; - EmptyValue* buckets[64]; mm_AllocInfo* mm_al; u64 mm_alCap;