[remove need for libJudy when using jgc garbage collector
John Meacham <john@repetae.net>**20100702094139
 Ignore-this: 7bdf186ff0391e31937ccf5863b0892b
] hunk ./src/data/rts/jhc_jgc.c 19
-
-static Pvoid_t  gc_roots       = NULL;  // extra roots in addition to the stack
hunk ./src/data/rts/jhc_jgc.c 32
-        int r; J1T(r,gc_inheap,(uintptr_t)s / MEGABLOCK_SIZE);
-        return r;
+        return (s < &_start || s > &_end);
hunk ./src/data/rts/jhc_jgc.c 35
-static void
-gc_add_root(gc_t gc, sptr_t root)
-{
-        if(IS_PTR(root)) {
-                entry_t *nroot = TO_GCPTR(root);
-                if(gc_check_heap(nroot)) {
-                        int r; J1S(r,gc_roots,(Word_t)nroot);
-                }
-        }
-}
hunk ./src/data/rts/jhc_jgc.c 45
+stack_grow(struct stack *s, unsigned grow)
+{
+        s->size += grow;
+        s->stack = realloc(s->stack, sizeof(uintptr_t)*s->size);
+        assert(s->stack);
+        debugf("stack:");
+        for(unsigned i = 0; i < s->ptr; i++) {
+                debugf(" %p", (void *)s->stack[i]);
+        }
+        debugf("\n");
+}
+
+inline static void
hunk ./src/data/rts/jhc_jgc.c 60
-                s->size += 1024 + n;
-                s->stack = realloc(s->stack, sizeof(uintptr_t)*s->size);
-                assert(s->stack);
-                debugf("stack:");
-                for(unsigned i = 0; i < s->ptr; i++) {
-                        debugf(" %p", (void *)s->stack[i]);
+                stack_grow(s,n + 1024);
+        }
+}
+
+static struct stack root_stack = EMPTY_STACK;
+
+static void
+gc_add_root(gc_t gc, sptr_t root)
+{
+        if(IS_PTR(root)) {
+                entry_t *nroot = TO_GCPTR(root);
+                if(gc_check_heap(nroot)) {
+                        stack_check(&root_stack,1);
+                        root_stack.stack[root_stack.ptr++] = nroot;
hunk ./src/data/rts/jhc_jgc.c 75
-                debugf("\n");
hunk ./src/data/rts/jhc_jgc.c 98
-        Word_t ix;
hunk ./src/data/rts/jhc_jgc.c 99
-        Word_t n_roots;
-        J1C(n_roots,gc_roots,0,-1);
-        stack_check(&stack, n_roots);
-        int r; for(ix = 0,(J1F(r,gc_roots,ix)); r; (J1N(r,gc_roots,ix))) {
-                debugf(" %p", (void *)ix);
-                gc_add_grey(&stack, (entry_t *)ix);
-        }
+        stack_check(&stack, root_stack.ptr);
+        memcpy(stack.stack + stack.ptr,root_stack.stack, root_stack.ptr * sizeof(root_stack.stack[0]));
+        stack.ptr += root_stack.ptr;
hunk ./src/data/rts/jhc_jgc.c 199
-                        (unsigned)n_roots
+                        (unsigned)root_stack.ptr
hunk ./src/data/rts/jhc_jgc.h 47
+#if 0
hunk ./src/data/rts/jhc_jgc.h 53
+#endif
hunk ./src/data/rts/slub.c 13
-static Pvoid_t  gc_inheap; // whether the megablock is in the heap
+//static Pvoid_t  gc_inheap; // whether the megablock is in the heap
hunk ./src/data/rts/slub.c 86
-        int r; J1S(r, gc_inheap, (uintptr_t)mb->base/MEGABLOCK_SIZE);
+//        int r; J1S(r, gc_inheap, (uintptr_t)mb->base/MEGABLOCK_SIZE);
hunk ./src/data/rts/slub.c 215
-                assert(s_block(val) == pg);
+                assert(S_BLOCK(val) == pg);