* libguile/threads.c (on_thread_exit): Add caveat about possible
segfault.
git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-8
* libguile/gc-malloc.c (scm_gc_malloc): Pass a non-zero size to
`GC_MALLOC ()' when SIZE is zero.
git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-2
* libguile/gc.c (protected_obj_count): Made `static'.
(scm_heap_size): Mapped to `heap-size' rather than `cell-heap-size'.
(scm_heap_free_size): New.
(scm_heap_total_allocated): New.
(scm_gc_stats): Rewritten. Return the (little) information available
from `libgc'.
(scm_gc_disable): New.
(scm_gc_enable): New.
(scm_storage_prehistory): Don't call `GC_add_roots ()' with
SCM_SYS_PROTECTS. Use `GC_is_visible ()' to check whether
SCM_SYS_PROTECTS is visible.
* libguile/gc.h (scm_gc_enable): New declaration.
(scm_gc_disable): New declaration.
(scm_gc_for_alloc): Removed.
(scm_gc_for_newcell): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-46
* libguile/symbols.c (lookup_interned_symbol): When a deleted weak pair
is encountered, remove it and update the hashtable's item count. Also,
check the hash table threshold and trigger a rehashing if needed.
(scm_i_c_mem2symbol): Allocate CELL using `scm_weak_car_pair ()' rather
than `scm_cons ()'.
(scm_i_mem2symbol): Likewise.
(scm_symbols_prehistory): Don't invoke `scm_permanent_object ()' for
SYMBOLS.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-44
* libguile/hashtab.c (scm_i_rehash): Don't invoke
`SCM_HASHTABLE_DECREMENT ()' when a weak pair is encountered in the
source bucket.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-43
* 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
* libguile/hashtab.c (weak_hashtables): Removed.
(SCM_WEAK_CELL_DELETED_P): New macro.
(START_WEAK_BUCKET_FIXUP): Added the HASHFN argument. Invoke
`scm_i_rehash ()' when pairs have been removed.
(END_WEAK_BUCKET_FIXUP): Added the HASHFN argument.
(make_hash_table): Use `SCM_NEWSMOB2 ()' instead of `SCM_NEWSMOB3 ()'
-- last argument used to be WEAK_HASHTABLES.
(scm_i_rehash): Handle weak hash tables.
(to_rehash): Removed.
(scm_internal_hash_fold): Use `SCM_WEAK_CELL_DELETED_P ()' rather than
hand-written equivalent code.
(rehash_after_gc): Removed.
(scm_hashtab_prehistory): Don't add it as an after-gc hook.
* libguile/hashtab.h (SCM_HASHTABLE_NEXT): Removed.
(SCM_HASHTABLE_NEXTLOC): Removed.
(SCM_SET_HASHTABLE_NEXT): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-38
* libguile/ports.c (register_finalizer_for_port): New.
(finalize_port): New.
(scm_new_port_table_entry): Call `register_finalizer_for_port ()'
before returning the new port.
(scm_ports_prehistory): Use `scm_gc_malloc_pointerless ()' instead of
`scm_gc_malloc ()' when allocating room for SCM_I_PORT_TABLE.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-37
* libguile/__scm.h (SCM_DEBUG): add SCM_DEBUG_MARKING_API
* libguile/gc.h (SCM_SET_GC_MARK): depending on
SCM_DEBUG_MARKING_API crash if someone is touching markbits
outside regular hours.
Rename ensure_marking() to scm_i_ensure_marking().
* libguile/inline.h (scm_double_cell, scm_cell): only set mark bits
for debugging if SCM_DEBUG_MARKING_API is unset
* libguile/gc-mark.c: Issue deprecation warning if we are marking
outside of the GC mark phase.
* libguile/gc-card.c: Include <config.h> and <count-one-bits.h>.
(scm_i_uint_bit_count): Remove.
(scm_i_card_marked_count): Use `count_one_bits_l ()' instead
of `scm_i_uint_bit_count ()'.
* libguile/gc-segment.c: Include <config.h> and <count-one-bits.h>.
(scm_i_heap_segment_marked_count): Use `count_one_bits_l ()' instead
of `scm_i_uint_bit_count ()'.
* libguile/private-gc.h (scm_i_uint_bit_count): Remove.
* libguile/struct.c (struct_finalizer_trampoline): New.
(scm_struct_gc_init): Removed.
(scm_i_structs_to_free): Removed.
(scm_free_structs): Removed.
(scm_make_struct): Register a finalizer for the new struct if need be.
(scm_struct_prehistory): Cleared.
* libguile/struct.h (scm_i_structs_to_free): Removed.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-33
* libguile/coop-pthreads.c: Include "smob.h".
(make_thread): Use `SCM_NEWSMOB' rather than `scm_cell'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-32
* libguile/symbols.c (lookup_interned_symbol): When checking for `NULL',
use `SCM2PTR' rather than `SCM_UNPACK' (this fixes a warning).
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-31
* libguile/smob.c (smob_mark): Check the 7-bit type tag and ignore those
whose type tag is not that of a SMOB in order to cleanly handle
free-list objects (this fixes a bug which showed up on SPARC64).
Also, don't mark & push ADDR itself.
(scm_gc_mark): Moved the definition and undefinition of
`CURRENT_MARK_PTR' and `CURRENT_MARK_LIMIT' here.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-30
* libguile/smob.c (scm_make_smob): Use `SCM_RETURN_NEWSMOB ()' instead of
`scm_cell ()' when instantiating the SMOB.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-27
* libguile/smob.c (scm_i_finalize_smob): New.
* libguile/smob.h (SCM_NEWSMOB): Register `scm_i_finalize_smob ()' as a
finalizer for Z if its SMOB type has a free function.
(SCM_NEWSMOB3): Likewise.
(scm_i_finalize_smob): New declaration.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-26
* libguile/mallocs.c (malloc_free): Removed.
(scm_init_mallocs): Don't invoke `scm_set_smob_free ()' because the
memory allocated by `scm_gc_malloc ()' will automatically be freed.
Furthermore, `malloc_free ()' used to invoke `free ()' instead of
`scm_gc_free ()' which is incorrect.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-25
* libguile/gc.c (finalizer_trampoline): Don't use `scm_call_2 ()' to
invoke the finalizer: directly call the C function instead.
(scm_gc_register_finalizer): Don't create a real subr with
`scm_c_make_gsubr ()': simply convert the C function pointer to an
`SCM' object instead.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-24
* 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
* libguile/environments.c (scm_make_environment): Use
`SCM_RETURN_NEWSMOB' instead of `scm_cell'.
(core_environments_observe): Use `SCM_NEWSMOB3' instead of
`scm_double_cell'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-17
* libguile/hashtab.c (scm_i_rehash): Return immediately if TABLE is weak.
(scm_hash_fn_create_handle_x): Explicitly mention that we don't support
weak alist vectors.
(scm_internal_hash_fold): Handle weak pairs within buckets.
* libguile/modules.c (scm_module_reverse_lookup): Handle weak alists
(currently, don't do anything if a NULL pair is met).
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-16