From cddb87313d138780359232c4d2a0dfa8a43b3583 Mon Sep 17 00:00:00 2001 From: Roger Sen Date: Sun, 29 Mar 2015 21:45:37 +0200 Subject: [PATCH] Updated GC api to remove deprecated methods --- src/c/alloc_2.d | 14 +++++++------- src/h/external.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d index 727539a8d..792347e36 100644 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -119,10 +119,10 @@ out_of_memory(size_t requested_bytes) { failure = 0; GC_gcollect(); - GC_oom_fn = out_of_memory_check; + GC_set_oom_fn(out_of_memory_check); { output = GC_MALLOC(requested_bytes); - GC_oom_fn = out_of_memory; + GC_set_oom_fn(out_of_memory); if (output != 0 && failure == 0) { method = 2; goto OUTPUT; @@ -789,9 +789,9 @@ init_alloc(void) * 3) Out of the incremental garbage collector, we only use the * generational component. */ - GC_no_dls = 1; - GC_all_interior_pointers = 0; - GC_time_limit = GC_TIME_UNLIMITED; + GC_set_no_dls(1); + GC_set_all_interior_pointers(0); + GC_set_time_limit(GC_TIME_UNLIMITED); GC_init(); #ifdef ECL_THREADS # if GC_VERSION_MAJOR > 7 || GC_VERSION_MINOR > 1 @@ -1103,8 +1103,8 @@ init_alloc(void) GC_old_start_callback = GC_start_call_back; GC_start_call_back = (void (*)(void))gather_statistics; #endif - GC_java_finalization = 1; - GC_oom_fn = out_of_memory; + GC_set_java_finalization(1); + GC_set_oom_fn(out_of_memory); GC_set_warn_proc(no_warnings); GC_enable(); } diff --git a/src/h/external.h b/src/h/external.h index 8b79f4aa1..179c14fac 100755 --- a/src/h/external.h +++ b/src/h/external.h @@ -769,9 +769,9 @@ extern ECL_API void ecl_gc(cl_type t); #endif #ifdef GBC_BOEHM -#define GC_enabled() (!GC_dont_gc) -#define GC_enable() GC_dont_gc = FALSE; -#define GC_disable() GC_dont_gc = TRUE; +#define GC_enabled() !GC_is_disabled() +#define GC_enable() GC_enable() +#define GC_disable() GC_disable() extern ECL_API void ecl_register_root(cl_object *p); #endif /* GBC_BOEHM */