Initial (bad) gc
This commit is contained in:
+10
-2
@@ -13,14 +13,22 @@ DEFUN(cool_func, "cool-func", (LispVal * a, LispVal *b), "(a &optional b)",
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv) {
|
||||
LispGCStats gc_stats;
|
||||
lisp_init();
|
||||
REGISTER_GLOBAL_FUNCTION(cool_func);
|
||||
push_stack_frame(Qnil, Qnil, Qnil);
|
||||
ReadStream s;
|
||||
const char BUF[] = "(1 'a)";
|
||||
const char BUF[] = "(cool-func 1 (cons 1 2))";
|
||||
read_stream_init(&s, BUF, sizeof(BUF) - 1);
|
||||
LispVal *l = read(&s);
|
||||
Ffuncall(Qcool_func, l);
|
||||
Feval(l);
|
||||
push_stack_frame(Qnil, Qnil, Qnil);
|
||||
for (size_t i = 0; i < 100; ++i) {
|
||||
Fcons(MAKE_FIXNUM(0x1234), LISP_LITSTR("a"));
|
||||
}
|
||||
pop_stack_frame();
|
||||
lisp_gc_now(&gc_stats);
|
||||
debug_print_gc_stats(stdout, &gc_stats);
|
||||
pop_stack_frame();
|
||||
lisp_shutdown();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user