From 3dfefdb2ca1a00145d67852e550d95717451772d Mon Sep 17 00:00:00 2001 From: ProgramSnail Date: Sun, 16 Mar 2025 11:24:47 +0300 Subject: [PATCH] Revert "[TMP] run mods" This reverts commit a79644ec43363206844f51e25706a7522ac889b3. --- Lama.opam | 2 +- performance/{_dune => dune} | 0 runtime/gc.c | 7 +---- runtime/gc.h | 2 +- runtime/runtime.c | 53 ------------------------------------- runtime32/{_dune => dune} | 0 6 files changed, 3 insertions(+), 61 deletions(-) rename performance/{_dune => dune} (100%) rename runtime32/{_dune => dune} (100%) diff --git a/Lama.opam b/Lama.opam index 33dffba4e..67e6f862c 100644 --- a/Lama.opam +++ b/Lama.opam @@ -8,7 +8,7 @@ license: "GPL-3.0-only" homepage: "https://github.com/PLTools/Lama" bug-reports: "https://github.com/PLTools/Lama/issues" depends: [ - "dune" {>= "3.11"} + "dune" {>= "3.3"} "posix-uname" "GT" "ostap" {>= "0.6"} diff --git a/performance/_dune b/performance/dune similarity index 100% rename from performance/_dune rename to performance/dune diff --git a/runtime/gc.c b/runtime/gc.c index 4695896e5..15159bd3c 100644 --- a/runtime/gc.c +++ b/runtime/gc.c @@ -56,8 +56,6 @@ void handler (int sig) { } void *alloc (size_t size) { - // return malloc(size); - // FIXME, disable gc #ifdef DEBUG_VERSION ++cur_id; #endif @@ -249,7 +247,6 @@ static void gc_root_scan_stack () { } void mark_phase (void) { - // FIXME, disable gc #if defined(DEBUG_VERSION) && defined(DEBUG_PRINT) fprintf(stderr, "marking has started\n"); fprintf(stderr, @@ -623,8 +620,7 @@ extern void __shutdown (void) { void clear_extra_roots (void) { extra_roots.current_free = 0; } void push_extra_root (void **p) { - // FIXME, disable gc - if (extra_roots.current_free > MAX_EXTRA_ROOTS_NUMBER) { + if (extra_roots.current_free >= MAX_EXTRA_ROOTS_NUMBER) { perror("ERROR: push_extra_roots: extra_roots_pool overflow\n"); exit(1); } @@ -634,7 +630,6 @@ void push_extra_root (void **p) { } void pop_extra_root (void **p) { - // FIXME, disable gc if (extra_roots.current_free == 0) { perror("ERROR: pop_extra_root: extra_roots are empty\n"); exit(1); diff --git a/runtime/gc.h b/runtime/gc.h index 54fc148e9..2cf7131d6 100644 --- a/runtime/gc.h +++ b/runtime/gc.h @@ -37,7 +37,7 @@ #define SET_FORWARD_ADDRESS(x, addr) (x = ((x & 3) | ((ptrt)(addr)))) // if heap is full after gc shows in how many times it has to be extended #define EXTRA_ROOM_HEAP_COEFFICIENT 2 -#define MINIMUM_HEAP_CAPACITY (64000000) +#define MINIMUM_HEAP_CAPACITY (64) #include #include diff --git a/runtime/runtime.c b/runtime/runtime.c index 8abfddf6d..9134853f8 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -845,30 +845,6 @@ extern void *Barray (aint* args, aint bn) { return r->contents; } -extern void *Barray_rev (aint* args, aint bn) { - data *r; - aint n = UNBOX(bn); - - PRE_GC(); - - for (aint i = 0; i < n; i++) { - push_extra_root((void**)&args[i]); - } - - r = (data *)alloc_array(n); - - for (int i = 0; i < n; i++) { - ((aint *)r->contents)[i] = args[n - i - 1]; - } - - for (aint i = n - 1; i >= 0; --i) { - pop_extra_root((void**)&args[i]); - } - - POST_GC(); - return r->contents; -} - #ifdef DEBUG_VERSION extern memory_chunk heap; #endif @@ -902,35 +878,6 @@ extern void *Bsexp (aint* args, aint bn) { return (void *)((data *)r)->contents; } -extern void *Bsexp_rev (aint* args, aint bn) { - sexp *r; - aint n = UNBOX(bn); - - PRE_GC(); - - aint fields_cnt = n - 1; - - for (aint i = 0; i < fields_cnt; i++) { - push_extra_root((void**)&args[i]); - } - - r = alloc_sexp(fields_cnt); - r->tag = 0; - - for (int i = 0; i < fields_cnt; i++) { - ((auint *)r->contents)[i] = args[fields_cnt - i]; - } - - r->tag = UNBOX(args[0]); - - for (aint i = fields_cnt - 1; i >= 0; --i) { - pop_extra_root((void**)&args[i]); - } - - POST_GC(); - return (void *)((data *)r)->contents; -} - extern aint Btag (void *d, aint t, aint n) { data *r; diff --git a/runtime32/_dune b/runtime32/dune similarity index 100% rename from runtime32/_dune rename to runtime32/dune