* libguile/gc.c (scm_gc): Don't use `scm_gc_running_p' as
an lvalue.
* libguile/gc.h (scm_gc_running_p): Define to 0.
* libguile/threads.h (scm_i_thread)[gc_running_p]: Remove.
* 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/__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.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/gc.c (scm_init_storage): Do not initialize SCM_I_PORT_TABLE
here: this is done in `scm_ports_prehistory ()'. This fixes the bug
mentioned in the previous patch log.
* libguile/ports.c (scm_new_port_table_entry): Slightly clarified the
code.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-4
* libguile/gc.c (scm_gc_stats): Fixed so that it returns a relevant
result instead of just `SCM_EOL'.
* libguile/ports.c: Include `assert.h'. Don't include `malloc.h'.
(scm_make_port_type): Use `scm_gc_realloc ()' instead of `realloc ()'.
(scm_new_port_table_entry): Likewise.
(scm_flush): Added an assertion on the port number.
(scm_ports_prehistory): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-3
* New file gc-segment-table.c: hold code for the segment table.
* Remove data that might be out of date; remove
scm_i_adjust_min_yield(). We don't store min_yields, since they
are only accurate at one point in time (when the sweep finishes).
We decide the min yield at that point from min_yield_fraction and
freelist->collected / freelist->swept
* Introduce scm_i_gc_heap_size_delta() replacing
scm_i_gc_grow_heap_p().
* Remove foo_1 fields containing penultimate results.
* After GC, count mark bit vector to discover number of live
objects. This simplifies hairy updates.
* Many formatting and layout cleanups.
* Fix in scm_i_sweep_card(): return the length of free_list returned,
rather than number of deleted objects.
* For mtrigger GCs: do not also run a full sweep after the gc() call, as
this is inconsistent with lazy sweeping.
* Remove scm_i_make_initial_segment().
* Use calloc in scm_i_make_empty_heap_segment() to save on
initialization code.
* New function scm_i_sweep_for_freelist() which sweeps, with proper
statistic variable updates.
* New segments are conceptually blocks with 100% reclaimable cells.
* Remove some useless constants/comments: SCM_HEAP_SIZE,
SCM_INIT_HEAP_SIZE, SCM_EXPHEAP, SCM_HEAP_SEG_SIZE
* Do not increment scm_cells_allocated() from the
scm_[double]cell(). This would be a race condition.
* Move some deprecation checks in separate functions to not distract
from main code flow.
* threads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp() and
scm_ia64_register_backing_store_base() instead of Linux-specific
implementations.
* gc.h (scm_ia64_register_backing_store_base, scm_ia64_ar_bsp):
New declarations.
* gc.c (__libc_ia64_register_backing_store_base): Declaration
removed.
(scm_ia64_register_backing_store_base, scm_ia64_ar_bsp): New, with
implementations for Linux and HP-UX.
* coop-pthreads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp()
and scm_ia64_register_backing_store_base() instead of
Linux-specific implementations.
* continuations.h (__libc_ia64_register_backing_store_base):
Declaration removed.
(scm_t_contregs): New "fresh" field.
* continuations.c (ia64_getcontext): Removed.
(scm_make_continuation): Use continuation fresh field instead of
interpreting getcontext return values (which isn't portable). Use
scm_ia64_ar_bsp() and scm_ia64_register_backing_store_base()
instead of Linux-specific implementations.
(copy_stack_and_call): Use scm_ia64_register_backing_store_base()
instead of Linux-specific implementation.
* _scm.h (__ia64__): Also detect __ia64.