modified libguile/hashtab.c @@ -1608,10 +1608,11 @@ scm_c_weak_table_fold (scm_t_hash_fold_fn fn, void *closure, +/* Initialize weak pairs, used by weak hash tables. This needs to be + done early on because it's used by interned symbols etc. */ void -scm_init_hashtab () +scm_init_weak_pairs () { - /* Initialize weak pairs. */ GC_word wcar_pair_bitmap[GC_BITMAP_SIZE (scm_t_cell)] = { 0 }; GC_word wcdr_pair_bitmap[GC_BITMAP_SIZE (scm_t_cell)] = { 0 }; @@ -1627,6 +1628,11 @@ scm_init_hashtab () wcdr_pair_descr = GC_make_descriptor (wcdr_pair_bitmap, GC_WORD_LEN (scm_t_cell)); +} + +void +scm_init_hashtab () +{ #include "libguile/hashtab.x" } modified libguile/hashtab.h @@ -174,6 +174,7 @@ SCM_API SCM scm_hash_map_to_list (SCM proc, SCM hash); SCM_API SCM scm_hash_count (SCM hash, SCM pred); SCM_INTERNAL void scm_i_hashtable_print (SCM exp, SCM port, scm_print_state *pstate); SCM_INTERNAL void scm_init_hashtab (void); +SCM_INTERNAL void scm_init_weak_pairs (void); /* Guile 2.2.x (x <= 2) weak-table API. */ modified libguile/init.c @@ -390,7 +390,8 @@ scm_i_init_guile (void *base) #ifdef GUILE_DEBUG_MALLOC scm_debug_malloc_prehistory (); #endif - scm_symbols_prehistory (); /* requires weak_table_prehistory */ + scm_init_weak_pairs (); + scm_symbols_prehistory (); /* requires weak_pairs */ scm_modules_prehistory (); scm_init_array_handle ();