[clean up jhc_jgc.c
John Meacham <john@repetae.net>**20100407045922
 Ignore-this: 4ec3feb0ec489693f570799829930921
] hunk ./src/data/rts/jhc_jgc.c 8
-// #define static 
-
hunk ./src/data/rts/jhc_jgc.c 27
-
hunk ./src/data/rts/jhc_jgc.c 54
-        //       if(SHOULD_FOLLOW(root)) {
-        //                       int r; J1S(r,gc_roots,(((Word_t)root - sizeof(entry_t)) / GC_ALIGNMENT));
-        //               return (bool)r;
-        //       } else
-        //               return false;
hunk ./src/data/rts/jhc_jgc.c 78
-/*
-static void
-gc_add_grey(Pvoid_t gc_grey[1], struct stack *stack, uintptr_t ix)
-{
-        int r;
-        J1U(r, gc_allocated, ix);
-        if(r) {
-                J1S(r, *gc_grey, ix);
-                if(r)
-                        stack->stack[stack->ptr++] = (uintptr_t)ix * GC_ALIGNMENT;
-        }
-}
-*/
-
hunk ./src/data/rts/jhc_jgc.c 97
-//        Pvoid_t gc_grey = NULL;
+
hunk ./src/data/rts/jhc_jgc.c 146
-                                if(gc_check_heap(ptr)) {
-                                        s_set_used_bit(TO_GCPTR(ptr));
-                                }
-                                /*
-                                J1U(r,gc_allocated,((uintptr_t)FROM_SPTR(ptr) - sizeof(entry_t))/GC_ALIGNMENT);
-                                if(r)
-                                        J1S(r,gc_grey,((uintptr_t)FROM_SPTR(ptr) - sizeof(entry_t))/GC_ALIGNMENT);
-                                        */
+                                void *gptr = TO_GCPTR(ptr);
+                                if(gc_check_heap(gptr))
+                                        s_set_used_bit(gptr);
hunk ./src/data/rts/jhc_jgc.c 159
-                entry_t *e = (entry_t *)TO_GCPTR(ptr); // (entry_t *)FROM_SPTR(ptr) - 1;
+                entry_t *e = TO_GCPTR(ptr);
hunk ./src/data/rts/jhc_jgc.c 161
-                //ix = (Word_t)e / GC_ALIGNMENT;
hunk ./src/data/rts/jhc_jgc.c 167
-                //uintptr_t ix = stack.stack[--stack.ptr] / GC_ALIGNMENT;
-                //debugf("Processing Grey: %p\n",(void *)(ix * GC_ALIGNMENT));
hunk ./src/data/rts/jhc_jgc.c 181
-                                entry_t * ptr = (entry_t *)TO_GCPTR(e->ptrs[i]);
-                                debugf("Following: %p %p\n",e->ptrs[i], (void *)ptr);
+                                entry_t * ptr = TO_GCPTR(e->ptrs[i]);
+                                debugf("Following: %p %p\n",e->ptrs[i], ptr);
hunk ./src/data/rts/jhc_jgc.c 188
-        //for(ix = 0, (J1F(r,gc_allocated,ix)); r; (J1N(r,gc_allocated,ix))) {
-        //        entry_t *e = (entry_t *)(ix * GC_ALIGNMENT);
-        //        mem_inuse -= (e->u.v.count + 1)*GC_BASE;
-        //        debugf("Freeing: %p\n", e);
-        //        s_free(e);
-                //free(e);
-        //}
-        //J1FA(r,gc_allocated);
-        //gc_allocated = gc_grey;
hunk ./src/data/rts/jhc_jgc.c 205
-                        );
-               jhc_malloc_fini(); 
+                       );
+                //               jhc_malloc_fini();
hunk ./src/data/rts/jhc_jgc.c 218
-//        static int c;
-        //if(__predict_false(mem_inuse > heap_threshold)) {
-//        if(c++ % 100000 == 0) {
- //               gc_perform_gc(gc);
-            //    if(__predict_false(mem_inuse > ((heap_threshold * 6) / 10))) {
-             //           heap_threshold *= 2;
-             //           if(JGC_STATUS)
-             //                   fprintf(stderr, "Increasing heap threshold to %u bytes because mem usage is %u.\n", (unsigned) heap_threshold, (unsigned)mem_inuse);
-             //   }
- //       }
-        //entry_t *e = malloc((count + 1)*GC_BASE);
-        entry_t *e = s_alloc(gc, find_cache(sc, arena, (count + 1), 0));
-        //mem_inuse += (count + 1)*GC_BASE;
+        entry_t *e = s_alloc(gc, find_cache(sc, arena, (count + 1), nptrs));
hunk ./src/data/rts/jhc_jgc.c 223
-//        int r; J1S(r,gc_allocated,(Word_t)e / GC_ALIGNMENT);
hunk ./src/data/rts/jhc_jgc.c 227
-// static void *
-// gc_alloc_bytes(gc_t gc,size_t count) {
-//         return gc_alloc_tag(gc, TO_BLOCKS(count), 0, 0);
-// }
-
hunk ./src/data/rts/jhc_jgc.c 241
-        if(0) {
+        if(1) {
hunk ./src/data/rts/jhc_jgc.c 253
-// #undef static