account, but keeping more or less the same values as previously.
added some simple helper macros.
(CLUSTER_SIZE_IN_BYTES, ALIGNMENT_SLACK): defined to take cards
into account.
(BVEC_*, scm_mark_space_t, current_mark_space, mark_space_ptr,
current_mark_space_offset, mark_space_head, get_bvec,
clear_mark_space): new functions and supporting variables, types
and macros that implement mark space management.
(scm_igc): clear the mark space (all of it) before beginning the
mark phase.
(scm_gc_mark): changed the tests for rogue cells, much simplified
throughout (no different mark bit locations to worry about now).
(scm_mark_locations): don't consider card header cells.
(scm_cellp): ditto.
(scm_gc_sweep): simplified.
(init_heap_seg): changed to take cards into account.
sweep time, total marked cells, total swept cells, and number of
times GC was invoked.
(gc_start_stats): renamed from scm_gc_start, made static, taught
to init the new stats.
(gc_end_stats): renamed from scm_gc_end, made static, taught to
calculate the new stats.
(scm_igc): don't call gc_start_stats unless we are sure that we
are indeed going to collect. also, added some timekeeping between
the mark and sweep phases.
(scm_gc_sweep): count number of cells we sweep as we go.
* gc.h: removed prototypes for scm_gc_{start,end}.
doesn't yield any new cells. In theory this could happen if all
cells allocated with NEWCELL are either in use or conservatively
marked and all cluster spine cells are conservatively marked.
(Thanks to Dirk.)
scm_default_min_yield_1, scm_default_init_heap_size_2,
scm_default_min_yield_2, scm_default_max_segment_size): New global
variables. Can be customized by the application before booting
Guile. (We might want to be able to control these parameters
dynamically through the "options interface" in the future, but
note that that is additional functionality. Here we're giving
default values which the environment variables can override.)
the yucky, ugly and nasty conditional compilation back. sorry,
but it was either that or requiring GAWK to build Guile.
removed the code that implemented the old GC scheme.
* init.c (scm_boot_guile_1): removed the code conditioned on
!GUILE_NEW_GC_SCHEME.
* __scm.h: (GUILE_NEW_GC_SCHEME): removed.
* gc.c (scm_protect_object, scm_unprotect_object): change the
implementation to more efficient (at least in the time complexity
sense). the calls should now also be thread-safe -- I suspect
that people expect them to be. (thanks to Han-Wen Nienhuys)
removed the code that implemented the old GC scheme.
* hashtab.c (scm_hash_fn_create_handle_x): add missing
SCM_REALLOW_INTS before return.
(scm_before_gc_c_hook, scm_before_mark_c_hook,
scm_before_sweep_c_hook, scm_after_sweep_c_hook,
scm_after_gc_c_hook): New C level hooks.
(scm_after_gc_hook): New Scheme level hook.
(scm_gc_sweep): Moved scanning of weak vectors to weaks.c.
(scm_igc): Moved initialization of scm_weak_vectors and the call
to scm_guardian_gc_init to respective module.
(scm_mark_weak_vector_spines): Moved to weaks.c;
Call to scm_guardian_zombify moved to guardians.c;
Run scm_before_gc_c_hook, scm_before_sweep_c_hook,
scm_after_gc_c_hook at appropriate places.
(scm_init_gc): Initialize scm_after_gc_hook.
and we don't want that.
(INCLUDES): Removed all -I options except for the root source
directory and the root build directory.
* *.*: Change includes so that they always use the "prefixes"
libguile/, qt/, guile-readline/, or libltdl/.
(Thanks to Tim Mooney.)
made SCM values into pointers. This turned an arithmetic
computation of the address of the vcell into a pointer-arithmetic
one, thereby screwing up marking of structs.
Bugfix 2: Removed incompletely introduced loop variable `j' used
when protecting the tail array of a struct.
prediction.
(SCM_MAX): New macro.
(scm_freelist_t): New field: collected_1. Previous amount of
collected cells.
(gc_sweep_freelist_finish): Trigger based on two last values of
freelist->collected to avoid unnecessary allocation due to
temporary peaks.
trigger adjustmeant: Take yield (freed cells) for all freelists
into account.
(SCM_INIT_HEAP_SIZE_1, SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Tuned
to 50000 cell heap with 45% trigger.
(scm_gc_cells_collected): Reintroduced.
(SCM_HEAP_SIZE): New macro.
(scm_gc_sweep): Reintroduced correct computation of
scm_cells_allocated.
(scm_freelist_t): Corrected commentary for field `cluster_size':
Clustersize counts objects, not cells; New member
`clusters_allocated'.