summaryrefslogtreecommitdiff
path: root/libguile/guardians.c
Commit message (Expand)AuthorAgeFilesLines
* Deprecate dynamic roots...* libguile/root.h: * libguile/root.c: Remove these files. * libguile/deprecated.h: * libguile/deprecated.c (scm_internal_cwdr, scm_call_with_dynamic_root) (scm_dynamic_root, scm_apply_with_dynamic_root): Deprecate. Remove all root.h usage, which was vestigial. * module/ice-9/serialize.scm: Use (current-thread) instead of (dynamic-root). Andy Wingo2016-11-211-1/+0
* Remove scm_puts_unlocked....* libguile/ports.h (scm_puts_unlocked): Remove. * libguile/ports.c (scm_puts): Replace implementation with scm_puts_unlocked's implementation. * libguile/arbiters.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/continuations.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/guardians.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/load.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/srfi-14.c: * libguile/stackchk.c: * libguile/struct.c: * libguile/threads.c: * libguile/throw.c: * libguile/values.c: * libguile/variable.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked. Andy Wingo2016-04-261-5/+5
* Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2013-11-281-7/+6
|\
| * Critical sections in guardians do not need to block asyncs...* libguile/guardians.c: Critical sections here cannot cause an async_tick, so they do not need to block asyncs. Andy Wingo2013-11-281-7/+6
* | Merge commit '2437c7b2e8b4ab7786847ee1ce0b59e446a70fe2'...Conflicts: libguile/guardians.c Andy Wingo2013-11-281-2/+16
|\|
| * Make guardians thread-safe....* libguile/guardians.c (t_guardian): Add mutex. (finalize_guarded, scm_i_guard, scm_i_get_one_zombie): Lock mutex and block system asyncs during critical sections. (scm_make_guardian): Initialize mutex. Mark H Weaver2013-11-231-2/+16
* | Remove tests and shims for pre-7.2 bdw-gc....* 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. Andy Wingo2013-11-221-6/+0
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: configure.ac libguile/deprecated.c libguile/deprecated.h libguile/filesys.h libguile/fluids.c libguile/fports.c libguile/gc.c libguile/guile.c libguile/numbers.c libguile/objcodes.c libguile/r6rs-ports.c libguile/smob.c libguile/socket.c libguile/threads.h module/language/scheme/decompile-tree-il.scm module/language/tree-il/peval.scm test-suite/tests/syncase.test Mark H Weaver2013-03-281-1/+7
|\|
| * Use accessors instead of symbols deprecated in libgc 7.3....* configure.ac: Check for `GC_set_all_interior_pointers', `GC_get_gc_no', and `GC_set_java_finalization'. * libguile/gc.c (scm_gc_stats)[HAVE_GC_GET_GC_NO]: Use `GC_get_gc_no'. (scm_storage_prehistory)[HAVE_GC_SET_ALL_INTERIOR_POINTERS]: Use `GC_set_all_interior_pointers'. * libguile/guardians.c (scm_init_guardians)[HAVE_GC_SET_JAVA_FINALIZATION]: Use `GC_set_java_finalization'. Ludovic Courtès2013-03-011-1/+7
* | Merge remote-tracking branch 'origin/stable-2.0'...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 Andy Wingo2012-07-061-5/+6
|\|
| * Use `void *' instead of `GC_PTR' internally....* 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'. Ludovic Courtès2012-07-021-5/+6
* | Revert "add SCM_HEAP_OBJECT_BASE"...This reverts commit 47ed8656db8800f3ad20a40eb2c4e9ef3dc891e3. Conflicts: libguile/foreign.c Andy Wingo2012-01-311-2/+0
* | locking for putc, puts...* libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions. Andy Wingo2011-11-081-5/+5
* | add SCM_HEAP_OBJECT_BASE...* libguile/tags.h (SCM_HEAP_OBJECT_BASE): New macro. Given a SCM, returns a pointer to the start of its memory area on the heap. * libguile/bytevectors.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/numbers.h: * libguile/ports.c: * libguile/smob.c: * libguile/struct.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it. Andy Wingo2011-10-241-0/+2
* | add SCM_HEAP_OBJECT_P...* libguile/tags.h (SCM_HEAP_OBJECT_P): New macro, an alias for SCM_NIMP. * libguile/arrays.c: * libguile/debug.c: * libguile/foreign.c: * libguile/gdbint.c: * libguile/guardians.c: * libguile/list.c: * libguile/modules.c: * libguile/options.c: * libguile/smob.c: * libguile/validate.h: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it instead of SCM_NIMP or !SCM_IMP. Andy Wingo2011-10-241-1/+1
* | add SCM_{PACK,UNPACK}_POINTER...* libguile/tags.h (SCM_UNPACK_POINTER, SCM_PACK_POINTER): New macros. The old SCM2PTR and PTR2SCM were defined in such a way that round-tripping through a pointer could lose precision, even in the case in which you weren't interested in actually dereferencing the pointer, it was simply that you needed to plumb a SCM through APIs that take pointers. These new macros are more like SCM_PACK and SCM_UNPACK, but for pointer types. The bit representation of the pointer should be the same as the scm_t_bits representation. * libguile/gc.h (PTR2SCM, SCM2PTR): Remove support for (old) UNICOS pointers. We are going to try tagging the SCM object itself in the future, and I don't think that keeping this support is worth its cost. It probably doesn't work anyway. * libguile/backtrace.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/hashtab.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/smob.c: * libguile/strings.c: * libguile/symbols.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Update many sites to use the new macros. Andy Wingo2011-10-241-10/+10
* | 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. Andy Wingo2011-10-241-6/+10
|/
* scm_is_false instead of == SCM_BOOL_F; also is_null, is_true, etc...* libguile/deprecation.c (scm_issue_deprecation_warning) * libguile/eval.c (CAPTURE_ENV): * libguile/goops.c (make_dispatch_procedure, make_class_from_symbol): (create_smob_classes): * libguile/guardians.c (finalize_guarded, scm_i_get_one_zombie): * libguile/hashtab.c (scm_fixup_weak_alist, scm_internal_hash_fold): * libguile/i18n.c (scm_nl_langinfo) * libguile/load.c (scm_primitive_load) * libguile/posix.c (scm_setrlimit) * libguile/socket.c (scm_to_sockaddr): * libguile/srcprop.c (scm_make_srcprops): Use scm_is_false / scm_is_true / scm_is_null instead of comparing against SCM_BOOL_F et al. Andy Wingo2011-05-131-4/+4
* more care regarding SCM_PACK and SCM_UNPACK...* libguile/control.c (reify_partial_continuation): * libguile/eval.c (RETURN_BOOT_CLOSURE): * libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x) * libguile/frames.h (SCM_FRAME_SET_RETURN_ADDRESS): (SCM_FRAME_SET_MV_RETURN_ADDRESS, SCM_FRAME_SET_DYNAMIC_LINK): * libguile/goops.c (scm_class_of, scm_primitive_generic_generic) (scm_c_extend_primitive_generic, compute_getters_n_setters) (scm_sys_initialize_object): * libguile/guardians.c (finalize_guarded): * libguile/list.c (SCM_I_CONS): * libguile/macros.c (scm_i_make_primitive_macro) (scm_make_syntax_transformer): * libguile/memoize.c (MAKMEMO, SCM_MAKE_MEMOIZER) (SCM_MAKE_REST_MEMOIZER): * libguile/modules.c (scm_module_reverse_lookup) * libguile/print.c (iprin1): * libguile/promises.c (scm_make_promise) * libguile/srcprop.c (scm_make_srcprops): * libguile/vectors.c (scm_c_vector_ref): * libguile/vm-engine.c (vm_engine) * libguile/vm-i-scheme.c (REL, add1, sub1): * libguile/vm-i-system.c (new_frame, call_cc) * libguile/weaks.h (SCM_WEAK_PAIR_WORD_DELETED_P): Be more careful about SCM_PACK / SCM_UNPACK. Andy Wingo2011-05-131-1/+1
* SCM_CELL in guardians.c...* libguile/guardians.c (GUARDIAN_DATA): Fix SCM_CELL macro usage. Andy Wingo2009-12-081-1/+1
* Remove deprecated guardian code....* libguile/guardians.c (guardian_apply): Remove `#if ENABLE_DEPRECATED' section since it was never compiled in, not even in 1.8. (scm_init_guardians): Likewise. Ludovic Courtès2009-11-171-12/+1
* Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution....* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'. * libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated. Update to LGPLv3+. Ludovic Courtès2009-09-141-1/+1
* Merge branch 'master' into boehm-demers-weiser-gc...Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4 Ludovic Courtès2009-08-181-6/+7
|\
| * Change Guile license to LGPLv3+...(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* ) Neil Jerram2009-06-171-6/+7
* | Add `DEBUG_GUARDIANS' macro for guardian finalization debugging....* libguile/guardians.c (finalize_guarded): Use `#ifdef DEBUG_GUARDIANS' instead of `#if 0'. Add " guardian for %p vanished\n" debugging statement. Ludovic Courtès2009-02-281-6/+14
* | Merge branch 'master' into boehm-demers-weiser-gc...Conflicts: lib/Makefile.am libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/private-gc.h m4/.cvsignore m4/gnulib-cache.m4 m4/gnulib-comp.m4 Ludovic Courtès2008-09-131-1/+4
|\|
| * Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès2008-09-131-1/+4
* | Use thread-local allocation (significant perf. improvement!); added the `boeh......* libguile/Makefile.am (modinclude_HEADERS): Added `boehm-gc.h'. * libguile/coop-defs.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/coop-threads.h: Likewise. * libguile/coop.c: Likewise. * libguile/gc.c: Likewise. (scm_storage_prehistory): Invoke `GC_init ()'. * libguile/guardians.c: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/inline.h: Likewise. (scm_double_cell): Use `GC_MALLOC' instead of `GC_malloc'. * libguile/pthread-threads.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>. * libguile/smob.c: Likewise. * libguile/smob.h: Likewise. * libguile/struct.c: Likewise. * libguile/threads.c: Likewise. * libguile/weaks.c: Likewise. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-51 Ludovic Courtes2008-09-101-1/+1
* | Allow guardians to be GC'd before the objects they guard....* libguile/guardians.c (finalize_guarded): While traversing GUARDIANS_LIST, check for deleted weak-car pairs. (scm_i_guard): Instantiate GUARDIANS_FOR_OBJ using `scm_weak_car_pair ()' rather than `scm_cons ()'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-41 Ludovic Courtes2008-09-101-2/+10
* | Fixed use of finalizers for guardians and SMOBs (undoes patches 23-24)....* libguile/gc.c (finalizer_trampoline): Removed. (scm_gc_register_finalizer): Removed (undoes patches 23 and 24). * libguile/gc.h (scm_gc_register_finalizer): Removed. * libguile/guardians.c (finalize_guarded): Undid patch 23. Added support for "proxied finalizers". (scm_i_guard): Likewise. * libguile/smob.c (scm_i_finalize_smob): Adapted to `GC_finalization_proc'. * libguile/smob.h: Include <gc/gc.h>. (SCM_NEWSMOB): Use `GC_REGISTER_FINALIZER_NO_ORDER' instead of `scm_gc_register_finalizer ()'. (SCM_NEWSMOB3): Likewise. (scm_i_finalize_smob): Updated. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-29 Ludovic Courtes2008-09-051-19/+80
* | Generalized BGC's finalizer mechanism. Use it in `guardians.c'....* libguile/gc.c (finalizer_trampoline): New. (scm_gc_register_finalizer): New. * libguile/gc.h (scm_gc_register_finalizer): New declaration. * libguile/guardians.c (finalize_guarded): Updated to the new prototype. (scm_i_guard): Use `scm_gc_register_finalizer ()' instead of `GC_REGISTER_FINALIZER_NO_ORDER ()'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-23 Ludovic Courtes2008-09-051-22/+14
* | First stab at the guardian implementation. Works fine at first glance!...* libguile/guardians.c: Overhauled. Removed the `tconc' structure. Much, much, simpler. (finalize_guarded): New function. * libguile/init.c (scm_i_init_guile): Call `scm_init_guardians ()'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-11 Ludovic Courtes2008-09-051-146/+95
* | Merge from lcourtes@laas.fr--2005-mobile...Patches applied: * lcourtes@laas.fr--2005-mobile/guile-core--boehm-gc--1.9 (base, patch 1) - tag of lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--base-0 - Initial hack for Boehm's GC support: nothing works. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-1 Ludovic Courtes2008-09-051-0/+3
|/
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* * gc-mark.c (scm_mark_all): Do not rely on hooks to run the weak...hashtable and guardian machinery but call the relevant functions directly. * guardians.h, guardians.c, deprecated.h, deprecated.c (scm_destroy_guardian_x, scm_guardian_greedy_p, scm_guardian_destroyed_p, scm_guard, scm_get_one_zombie): Deprecated and moved into deprecated.[ch]. * guardians.h, guardians.c: Mostly rewritten. (scm_i_init_guardians_for_gc, scm_i_identify_inaccessible_guardeds, scm_i_mark_inaccessible_guardeds): New. * weaks.h, weaks.c (SCM_I_WVECT_TYPE, SCM_I_SET_WVECT_TYPE): New. (SCM_I_WVECT_N_ITEMS, SCM_I_SET_WVECT_N_ITEMS): New. (SCM_WVECTF_NOSCAN, SCM_WVECT_NOSCAN_P): Removed. (scm_weaks_prehistory): Removed. (scm_i_init_weak_vectors_for_gc, scm_i_mark_weak_vector, scm_i_mark_weak_vectors_non_weaks, scm_i_remove_weaks_from_weak_vectors, scm_i_remove_weaks): New. (scm_weak_vector_gc_init, scm_mark_weak_vector_spines, scm_scan_weak_vectors): Removed. * hashtab.h (scm_i_scan_weak_hashtables): New. * hashtab.c (make_hash_table, scm_i_rehash): Do not use SCM_WVECTF_NOSCAN. (hashtable_print): Use SCM_HASHTABLE_N_ITEMS instead of t->n_items. (scan_weak_hashtables, scm_i_scan_weak_hashtables): Renamed former to latter. Do not scan the alists themselves, this is done by the weak vector code now. Just update the element count. * vectors.h (SCM_I_WVECT_TYPE, SCM_I_WVECT_EXTRA): Renamed former to latter. The type is now only part of the cell word. (SCM_I_SET_WVECT_TYPE, SCM_I_SET_WVECT_EXTRA): Likewise. * init.c (scm_i_init_guile): Do not call scm_weaks_prehistory. Marius Vollmer2005-07-311-444/+174
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* Critical section reviewNeil Jerram2005-04-241-1/+6
* Include "libguile/async.h" for SCM_CRITICAL_SECTION_START/END.Marius Vollmer2005-03-071-0/+1
* See ChangeLog from 2005-03-02.Marius Vollmer2005-03-021-14/+15
* * variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,...print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c, guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use scm_uintprint to print unsigned integers, raw heap words, and adresses, using a cast to scm_t_bits to turn pointers into integers. Marius Vollmer2004-10-221-1/+1
* *** empty log message ***Marius Vollmer2004-09-221-3/+3
* * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into...deprecated.h. Replaced all uses with scm_is_eq. Marius Vollmer2004-07-271-3/+3
* * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,...SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate. Marius Vollmer2004-07-231-1/+1
* * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to...SCM_I_MAKINUM and changed all uses. Marius Vollmer2004-07-081-1/+1
* * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,...SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. Marius Vollmer2004-07-061-6/+6
* * dynl.c (SET_DYNL_HANDLE): Add cast to scm_t_bits to make... explicit what happens. * guardians.c (TCONC_IN): Use SCM_SET_CELL_OBJECT_x rather than SCM_SET_CELL_WORD_x when writing scheme objets to cell elements. Dirk Herrmann2004-05-151-2/+2
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-36/+12
* new gcHan-Wen Nienhuys2002-08-041-6/+6
* Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen2002-03-141-2/+0
* * gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when...non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer. Marius Vollmer2002-02-111-3/+3