summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-10 23:23:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-10 23:23:49 -0700
commit4abe7b8300a89d4b8c3b3277076e76f20754b27e (patch)
tree071fcf57bcdddd1600de4f2c70e6720061b24be5 /gc.c
parent48d917f2f18f91e418189b7fc41f7a9651e40b42 (diff)
downloadtxr-4abe7b8300a89d4b8c3b3277076e76f20754b27e.tar.gz
txr-4abe7b8300a89d4b8c3b3277076e76f20754b27e.tar.bz2
txr-4abe7b8300a89d4b8c3b3277076e76f20754b27e.zip
gc: add argument to sys:gc.
* gc.c (gc_wrap): Takes argument for requesting full garbage collection. (gc_late_init): Update registration of gc intrinsic. * txr.1: Documented.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index dc1a1939..a9f6195c 100644
--- a/gc.c
+++ b/gc.c
@@ -965,9 +965,12 @@ static val gc_set_delta(val delta)
return nil;
}
-static val gc_wrap(void)
+static val gc_wrap(val full)
{
if (gc_enabled) {
+#if CONFIG_GEN_GC
+ full_gc = !null_or_missing_p(full);
+#endif
gc();
return t;
}
@@ -1026,7 +1029,7 @@ val valid_object_p(val obj)
void gc_late_init(void)
{
- reg_fun(intern(lit("gc"), system_package), func_n0(gc_wrap));
+ reg_fun(intern(lit("gc"), system_package), func_n1o(gc_wrap, 0));
reg_fun(intern(lit("gc-set-delta"), system_package), func_n1(gc_set_delta));
reg_fun(intern(lit("finalize"), user_package), func_n3o(gc_finalize, 2));
reg_fun(intern(lit("call-finalizers"), user_package),