mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +02:00
remove weak pairs, rewrite weak vectors
* libguile/weak-vector.c: * libguile/weak-vector.h: Renamed from weaks.[ch]. Remove weak pairs. They were not safe to access with `car' and `cdr'. Remove weak alist vectors, as we have weak tables and sets. Reimplement weak vectors, moving the implementation here. * libguile/vectors.c: * libguile/vectors.h: Remove the extra header word. Use scm_c_weak_vector_ref / scm_c_weak_vector_set_x to access weak vectors. * libguile/snarf.h: Remove the extra header word in vectors. * libguile/threads.c (do_thread_exit, fat_mutex_lock, fat_mutex_unlock): Instead of weak pairs, store thread-owned mutexes in a list of one-element weak vectors. * libguile/guardians.c (finalize_guarded): Similarly, store object guardians in a list of one-element weak vectors. * libguile/modules.c (scm_module_reverse_lookup): We no longer need to handle the case of weak references. * libguile/print.c (iprin1): Use the standard vector accessor to print vectors. * libguile.h: * libguile/Makefile.am: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/goops.c: * libguile/init.c: * libguile/objprop.c: * libguile/struct.c: Update includes. * module/ice-9/weak-vector.scm: Load weak vector definitions using an extension instead of %init-weaks-builtins. * test-suite/tests/weaks.test: Use the make-...-hash-table names instead of the old alist vector names.
This commit is contained in:
parent
c4e83f74c2
commit
a141db8604
22 changed files with 364 additions and 642 deletions
|
@ -133,7 +133,6 @@
|
|||
#include "libguile/version.h"
|
||||
#include "libguile/vm.h"
|
||||
#include "libguile/vports.h"
|
||||
#include "libguile/weaks.h"
|
||||
#include "libguile/guardians.h"
|
||||
#include "libguile/extensions.h"
|
||||
#include "libguile/uniform.h"
|
||||
|
@ -383,12 +382,11 @@ scm_i_init_guile (void *base)
|
|||
|
||||
scm_storage_prehistory ();
|
||||
scm_threads_prehistory (base); /* requires storage_prehistory */
|
||||
scm_weaks_prehistory (); /* requires storage_prehistory */
|
||||
scm_weak_table_prehistory (); /* requires storage_prehistory */
|
||||
#ifdef GUILE_DEBUG_MALLOC
|
||||
scm_debug_malloc_prehistory ();
|
||||
#endif
|
||||
scm_symbols_prehistory (); /* requires weaks_prehistory */
|
||||
scm_symbols_prehistory (); /* requires weak_table_prehistory */
|
||||
scm_modules_prehistory ();
|
||||
scm_init_array_handle ();
|
||||
scm_bootstrap_bytevectors (); /* Requires array-handle */
|
||||
|
@ -489,9 +487,9 @@ scm_i_init_guile (void *base)
|
|||
scm_init_throw (); /* Requires smob_prehistory */
|
||||
scm_init_trees ();
|
||||
scm_init_version ();
|
||||
scm_init_weaks ();
|
||||
scm_init_weak_set ();
|
||||
scm_init_weak_table ();
|
||||
scm_init_weak_vectors ();
|
||||
scm_init_guardians (); /* requires smob_prehistory */
|
||||
scm_init_vports ();
|
||||
scm_init_standard_ports (); /* Requires fports */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue