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'.
* gc.h: (typedef struct scm_freelist_t) remove from here.
* gc.c: (CELL_UP, CELL_DN) make these macros take additional
parameter (the span).
(CLUSTER_SIZE_IN_BYTES, ALIGNMENT_SLACK) new macros.
(typedef struct scm_freelist_t) move here from gc.h, it had no
business being externally visible.
(typedef struct scm_heap_seg_data_t) renamed from
scm_heap_seg_data, to be style-compliant.
(scm_mark_locations) if the possible pointer points to a
multy-cell, check that it's properly aligned.
(init_heap_seg) alighn multy-cells properly, work with the
assumption that the segment size divides cleanly by cluster size
(so that there's no spill).
(round_to_cluster_size) new function.
(alloc_some_heap, make_initial_segment) use round_to_cluster_size
to satisfy the new init_heap_seg invariant.
Cluster sizes are now independent of GC trigger values.
GUILE_GC_TRIGGER_n can now specify a relative trigger value:
A negative integer gives fraction of total heap size in percent.
(SCM_GC_TRIGGER_1, SCM_GC_TRIGGER_2): Default values set to -40.
Cluster sizes are now independent of GC trigger values.
GUILE_GC_TRIGGER_n can now specify a relative trigger value:
A negative integer gives fraction of total heap size in percent.
allocating heap. The basic idea is to trigger GC every Nth
allocated cell and grow heap when free list runs out. The scheme
has been extended so that GC isn't triggered until all remaining
cells are used. The implementation is also prepared for
development in the direction of POSIX threads.
* gc.c (SCM_EXPHEAP): In order to grow by a factor of 1.5,
SCM_EXPHEAP should return half of the heap size.
all of Guile basics fits into one segment and there suitable room
for work.
(SCM_EXPHEAP): Now takes an argument. Grow by a factor of 1.5
instead of 2.
(scm_freelist, scm_freelist2): Now of type scm_freelist_t.
Freelists now contains information about object span, cells
collected and amount of cells in heap segments belonging to the
list.
(scm_heap_size, scm_gc_cells_collected): Removed.
numbers.h, objects.c, ramap.c, random.c, unif.c, unif.h: Extensive
rewrite of handling of real and complex numbers.
(SCM_FLOATS, SCM_SINGLES): These #ifdef conditionals have been
removed along with the support for floats. (Float vectors are
still supported.)
* gc.c (scm_freelist2): multi-cell freelists.
(inner_map_free_list): map_free_list, parameterized on ncells.
"nn cells in segment mm" was misleading for ncells > 1; changed to
"objects". still print cells too, though.
(scm_map_free_list): rewritten using inner_map_free_list.
(scm_check_freelist): get freelist as parameter, since now we have
more than one.
(scm_debug_newcell2): multi-cell variants of
scm_debug_newcell.
(scm_gc_for_newcell): take ncells and freelist pointer as
parameters.
(scm_gc_mark): add case for tc7_pws (procedures with setters are
now double cells).
(scm_gc_sweep): don't free the float data, since it's not malloced
anymore.
(init_heap_seg): didn't understand what n_new_objects stood for,
so changed to n_new_cells.
(make_initial_segment): new function, makes an initial segment
according to given ncells.
(scm_init_storage): call make_initial_segment, for ncells={1,2,3}.
eliminating some warnings.
* unif.c, strports.c, print.c, options.c: Fix some warnings on
mis-use of SCM/long
* gc.c, gc.h: Added scm_return_first_int(), and added comment re:
what the scm_return_first* functions do.