hash tables have a tc7
[bpt/guile.git] / libguile / gc.c
index 84d5ba8..4bedb05 100644 (file)
@@ -40,7 +40,7 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
 #include "libguile/stackchk.h"
 #include "libguile/struct.h"
 #include "libguile/smob.h"
-#include "libguile/unif.h"
+#include "libguile/arrays.h"
 #include "libguile/async.h"
 #include "libguile/ports.h"
 #include "libguile/root.h"
@@ -56,7 +56,7 @@ extern unsigned long * __libc_ia64_register_backing_store_base;
 #include "libguile/gc.h"
 #include "libguile/dynwind.h"
 
-#include "libguile/boehm-gc.h"
+#include "libguile/bdw-gc.h"
 
 #ifdef GUILE_DEBUG_MALLOC
 #include "libguile/debug-malloc.h"
@@ -146,18 +146,7 @@ scm_assert_cell_valid (SCM cell)
       */
       if (scm_expensive_debug_cell_accesses_p)
        scm_i_expensive_validation_check (cell);
-#if (SCM_DEBUG_MARKING_API == 0)
-      if (!SCM_GC_MARK_P (cell))
-       {
-         fprintf (stderr,
-                  "scm_assert_cell_valid: this object is unmarked. \n"
-                  "It has been garbage-collected in the last GC run: "
-                  "%lux\n",
-                   (unsigned long) SCM_UNPACK (cell));
-         abort ();
-       }
-#endif /* SCM_DEBUG_MARKING_API */
-      
+
       scm_i_cell_validation_already_running = 0;  /* re-enable */
     }
 }
@@ -208,17 +197,10 @@ scm_t_c_hook scm_after_sweep_c_hook;
 scm_t_c_hook scm_after_gc_c_hook;
 
 
-/* scm_mtrigger
- * is the number of bytes of malloc allocation needed to trigger gc.
- */
-unsigned long scm_mtrigger;
-
 /* GC Statistics Keeping
  */
-unsigned long scm_mallocated = 0;
 unsigned long scm_gc_ports_collected = 0;
 
-
 static unsigned long protected_obj_count = 0;
 
 
@@ -649,7 +631,7 @@ scm_storage_prehistory ()
      pointer to an 8-octet aligned region).  For `scm_tc3_struct', this is
      handled in `scm_alloc_struct ()'.  */
   GC_REGISTER_DISPLACEMENT (scm_tc3_cons);
-  GC_REGISTER_DISPLACEMENT (scm_tc3_closure);
+  /* GC_REGISTER_DISPLACEMENT (scm_tc3_unused); */
 
   /* Sanity check.  */
   if (!GC_is_visible (scm_sys_protects))
@@ -673,8 +655,6 @@ scm_init_storage ()
   while (j)
     scm_sys_protects[--j] = SCM_BOOL_F;
 
-  j = SCM_HEAP_SEG_SIZE;
-
 #if 0
   /* We can't have a cleanup handler since we have no thread to run it
      in. */
@@ -689,7 +669,6 @@ scm_init_storage ()
 
 #endif
 
-  scm_stand_in_procs = scm_make_weak_key_hash_table (scm_from_int (257));
   scm_protects = scm_c_make_hash_table (31);
 
   return 0;
@@ -775,18 +754,14 @@ scm_i_tag_name (scm_t_bits tag)
       return "cons (immediate car)";
     case scm_tcs_cons_nimcar:
       return "cons (non-immediate car)";
-    case scm_tcs_closures:
-      return "closures";
     case scm_tc7_pws:
       return "pws";
+    case scm_tc7_hashtable:
+      return "hashtable";
     case scm_tc7_wvect:
       return "weak vector";
     case scm_tc7_vector:
       return "vector";
-#ifdef CCLO
-    case scm_tc7_cclo:
-      return "compiled closure";
-#endif
     case scm_tc7_number:
       switch (tag)
        {
@@ -816,8 +791,8 @@ scm_i_tag_name (scm_t_bits tag)
     case scm_tc7_variable:
       return "variable";
       break;
-    case scm_tcs_subrs:
-      return "subrs";
+    case scm_tc7_gsubr:
+      return "gsubr";
       break;
     case scm_tc7_port:
       return "port";
@@ -841,8 +816,7 @@ scm_init_gc ()
   scm_after_gc_hook = scm_permanent_object (scm_make_hook (SCM_INUM0));
   scm_c_define ("after-gc-hook", scm_after_gc_hook);
 
-  gc_async = scm_c_make_subr ("%gc-thunk", scm_tc7_subr_0,
-                             gc_async_thunk);
+  gc_async = scm_c_make_gsubr ("%gc-thunk", 0, 0, 0, gc_async_thunk);
 
   scm_c_hook_add (&scm_after_gc_c_hook, mark_gc_async, NULL, 0);