summaryrefslogtreecommitdiff
path: root/libguile/finalizers.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-22Remove tests and shims for pre-7.2 bdw-gc.Andy Wingo1-11/+0
* configure.ac: Remove checks for symbols present in bdw-gc 7.2. * libguile/finalizers.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/guardians.c: * libguile/scmsigs.c: * libguile/threads.c: Remove shims.
2013-05-30Do not assume `pthread_t' is an integer type.Ludovic Courtès1-10/+15
Fixes <http://bugs.gnu.org/14469>. Reported by Panicz Maciej Godek <godek.maciek@gmail.com>. * libguile/finalizers.c (finalization_thread_is_running): New variable. (start_finalization_thread): Use it to determine whether FINALIZATION_THREAD is up and running. (stop_finalization_thread): Likewise.
2013-01-20consolidate scm_i_register_weak_gc_callback, update weak-set to fitAndy Wingo1-1/+59
* libguile/finalizers.h: * libguile/finalizers.c (scm_i_register_weak_gc_callback): New internal helper, from weak-set.c. Relative to the previous weak-set.c version, prefer the finalizer-based implementation. Fix bug regarding confusion between scm_before_gc_c_hook and scm_after_gc_hook. Fix bug regarding referencing weak values outside of the alloc lock. * libguile/weak-set.c (GC_move_disappearing_link): New stub. GC_move_disappearing_link is only available in libgc 7.3. (move_weak_entry): Use the new stub instead of ifdeffery. (resize_set): Now that we run finalizers from a separate thread or async, we can keep the lock while reallocating the set vector. (do_vacuum_weak_set): For the same reason, always lock the set. Remove implementation of scm_c_register_weak_gc_callback in preference of the new copy in finalizers.c. (scm_c_make_weak_set): Use the new scm_i_register_weak_gc_callback.
2012-07-06Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-1/+1
Conflicts: libguile/expand.c libguile/hashtab.c libguile/ports.c libguile/vectors.c libguile/weaks.c module/language/ecmascript/compile-tree-il.scm module/language/tree-il/effects.scm module/language/tree-il/fix-letrec.scm module/language/tree-il/peval.scm test-suite/tests/peval.test
2012-07-02Use `void *' instead of `GC_PTR' internally.Ludovic Courtès1-1/+1
* libguile/finalizers.c, libguile/foreign.c, libguile/guardians.c, libguile/hashtab.c, libguile/numbers.c, libguile/ports.c, libguile/smob.c, libguile/struct.c, libguile/vectors.c, libguile/weaks.c: Use `void *' instead of `GC_PTR'.
2012-03-08Merge remote-tracking branch 'local-2.0/stable-2.0'Andy Wingo1-5/+18
Conflicts: configure.ac libguile/finalizers.c libguile/finalizers.h libguile/gc.c libguile/gc.h libguile/inline.c libguile/inline.h libguile/ports.c libguile/smob.c libguile/smob.h module/ice-9/deprecated.scm module/ice-9/r4rs.scm
2012-03-08run finalizers asynchronously in asyncsAndy Wingo1-0/+56
* libguile/finalizers.c: New excitement! We'll be running finalizers asynchronously, from asyncs. This will make it safer to allocate while holding a mutex. (GC_set_finalizer_notifier): Add back-compat shim. * libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism during boot. * libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing on demand. (scm_gc): Explicitly run finalizers here. * libguile/threads.c (guilify_self_2): Run finalizers here if queue_finalizer_async happened to run during guilify_self_1. * configure.ac: Add check for GC_set_finalizer_notifier.
2012-03-08add scm_i_set_finalizer, scm_i_add_finalizer, scm_i_add_resuscitatorAndy Wingo1-0/+126
* libguile/finalizers.h: * libguile/finalizers.c: New files. * libguile.h: * libguile/Makefile.am: Add to build.
2012-02-24fixes to threaded finalizersAndy Wingo1-12/+23
* libguile/finalizers.c (finalization_thread_proc): (run_finalization_thread): (start_finalization_thread): (stop_finalization_thread): Use pthreads + scm_with_guile instead of scm_spawn_thread, to avoid deadlocks.
2012-02-24run finalizers asynchronously (in asyncs and/or pthreads)Andy Wingo1-0/+178
* libguile/finalizers.c: New excitement! We'll be running finalizers in threads, if that's available. If it's not available, during early boot, we can run finalizers in asyncs. This will make it safer to allocate while holding a mutex. * libguile/posix.c (scm_fork): Shut down the finalizer thread before forking. * libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism during boot and, if available, initialialize the finalizer thread at the very end. * libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing on demand. (scm_gc): Explicitly run finalizers here. If you're calling this function, you probably want synchronous GC.
2012-02-19add scm_i_set_finalizer, scm_i_add_finalizer, scm_i_add_resuscitatorAndy Wingo1-0/+126
* libguile/finalizers.h: * libguile/finalizers.c: New files. * libguile.h: * libguile/Makefile.am: Add to build.