diff options
| author | Felix Perktold <Felix.Perktold@student.uibk.ac.at> | 2026-01-25 01:41:00 +0100 |
|---|---|---|
| committer | Felix Perktold <Felix.Perktold@student.uibk.ac.at> | 2026-01-25 01:41:00 +0100 |
| commit | fc750d1d9303776cf00971b5fbf1a1c3e5d45c16 (patch) | |
| tree | 6ef0bfb0c31ed898f22b9d7d8cf03a5e0c337203 | |
| parent | 15b883e68f620592cafada6ef7f6c698a2c216c2 (diff) | |
fix
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | lisp.c | 5 | ||||
| -rw-r--r-- | lisp.h | 2 |
3 files changed, 6 insertions, 5 deletions
@@ -48,9 +48,9 @@ run_std: main modules: $(MODULE_SO) @echo "All modules built successfully." -modules/%.so: modules/%.c lisp.o +modules/%.so: modules/%.c gcc -fPIC -c $< -o $*.o - gcc -fPIC -shared $*.o lisp.o -o $@ $(MODULE_LIBS) + gcc -fPIC -shared $*.o -o $@ $(MODULE_LIBS) rm $*.o .PHONY: clean test run @@ -499,9 +499,9 @@ void mark_val(value *val) { void mark_env(env *e) { if (!e || e->marked) { return; } - e->marked = 1; for (env *cur = e; cur; cur = cur->next) { + cur->marked = 1; if (cur->value) { mark_val(cur->value); } @@ -546,7 +546,7 @@ void free_value(value *val) { free(val); } -int sweep() { +void sweep() { reg *r = global_reg; reg *prev = NULL; @@ -578,6 +578,7 @@ void reset_env_marks(env *e) { } void reset_marks() { + reset_env_marks(global_env); for (reg *r = global_reg; r; r = r->next) { if (r->value) { r->value->marked = 0; @@ -35,7 +35,7 @@ reg *reg_add(value *val); extern reg *global_reg; void mark_env(env *e); void mark_val(value *v); -int sweep(); +void sweep(); void free_env(env *e); void free_value(value *v); void reset_env_marks(env *e); |
