Fix initialization of the SMOB GC "kind".
authorLudovic Courtès <ludo@gnu.org>
Fri, 31 Oct 2008 20:55:55 +0000 (21:55 +0100)
committerLudovic Courtès <ludo@gnu.org>
Fri, 31 Oct 2008 20:55:55 +0000 (21:55 +0100)
* libguile/smob.c (scm_smob_prehistory): When initializing
  SMOB_GC_KIND, pass 1 as the CLEAR_NEW_OBJECTS argument to
  `GC_new_kind ()'.  Without this, an assertion failure is
  triggered in libgc's `reclaim.c'.

libguile/smob.c

index eec0e3e..0ad4a35 100644 (file)
@@ -637,7 +637,10 @@ scm_smob_prehistory ()
   smob_freelist = GC_new_free_list ();
   smob_gc_kind = GC_new_kind ((void **)smob_freelist,
                              GC_MAKE_PROC (GC_new_proc (smob_mark), 0),
-                             0, 0);
+                             0,
+                             /* Clear new objects.  As of version 7.1, libgc
+                                doesn't seem to support passing 0 here.  */
+                             1);
 
   scm_numsmob = 0;
   for (i = 0; i < MAX_SMOB_COUNT; ++i)