weak-table consolidation around scm_i_register_weak_gc_callback
authorAndy Wingo <wingo@pobox.com>
Sun, 20 Jan 2013 11:41:15 +0000 (12:41 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 20 Jan 2013 11:41:15 +0000 (12:41 +0100)
commitd7cb7f7925ff4a4059eb7a81a1ba5ee53e259810
tree95771bfe4d06b59c3290e3b95e9626934be03fee
parenta0551390d5a3dd4e9ca0920be9cf0883f36a941e
weak-table consolidation around scm_i_register_weak_gc_callback

* libguile/weak-table.c (GC_move_disappearing_link)
  (move_disappearing_links): Factor out stub, as in previous weak-set
  commit.
  (resize_table): As in weak-set commit, finalizers do not run within
  allocators.
  (do_vacuum_weak_table): Add comment about need for trylock.
  (scm_c_make_weak_table): Use the new scm_i_register_weak_gc_callback.
  Previously this was the case because of a mistyped check for a
  "HAVE_GC_TABLE_START_CALLBACK" symbol, whereas the symbol was actually
  HAVE_GC_SET_START_CALLBACK.  Anyway, it's better to call this after GC
  anyway, as vacuuming might need to allocate weak links (on pre-7.3
  libgc without GC_move_disappearing_link) or reallocate the backing
  vector.
libguile/weak-table.c