shithub: femtolisp

Download patch

ref: 23b728155ffb446ffc4e6ac8041ff8302595b28c
parent: a2b57453cbe3926e4e0425893bbc4565683fdf25
author: JeffBezanson <jeff.bezanson@gmail.com>
date: Sun May 2 19:23:00 EDT 2010

some boehm gc tweaks


--- a/femtolisp/cvalues.c
+++ b/femtolisp/cvalues.c
@@ -671,9 +671,6 @@
     if (t->vtable != NULL && t->vtable->relocate != NULL)
         t->vtable->relocate(v, ncv);
     forward(v, ncv);
-#ifdef BOEHM_GC
-    cv->data = NULL;
-#endif
     return ncv;
 }
 
--- a/femtolisp/flisp.c
+++ b/femtolisp/flisp.c
@@ -245,7 +245,7 @@
     symbol_t *sym;
     size_t len = strlen(str);
 
-    sym = (symbol_t*)LLT_ALLOC(sizeof(symbol_t)-sizeof(void*) + len + 1);
+    sym = (symbol_t*)malloc(sizeof(symbol_t)-sizeof(void*) + len + 1);
     assert(((uptrint_t)sym & 0x7) == 0); // make sure malloc aligns 8
     sym->left = sym->right = NULL;
     sym->flags = 0;
@@ -602,7 +602,7 @@
 static void grow_stack()
 {
     size_t newsz = N_STACK + (N_STACK>>1);
-    value_t *ns = LLT_REALLOC(Stack, newsz*sizeof(value_t));
+    value_t *ns = realloc(Stack, newsz*sizeof(value_t));
     if (ns == NULL)
         lerror(MemoryError, "stack overflow");
     Stack = ns;
@@ -2163,7 +2163,7 @@
     htable_new(&printconses, 32);
     comparehash_init();
     N_STACK = 262144;
-    Stack = LLT_ALLOC(N_STACK*sizeof(value_t));
+    Stack = malloc(N_STACK*sizeof(value_t));
 
     FL_NIL = NIL = builtin(OP_THE_EMPTY_LIST);
     FL_T = builtin(OP_BOOL_CONST_T);