* 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.
* 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.
mallocating for (unsigned long *bounds).
* hashtab.c (scm_i_rehash): Cast SCM_HASHTABLE_FLAGS (table) to
scm_t_bits before storing them in the type word.
* gc.c (tag_table_to_type_alist): Modified type of c_tag from
scm_t_bits to int.
code.
* gc.c (s_scm_gc_live_object_stats): Don't declare alist in middle
of code.
* gc-card.c (scm_i_card_statistics): Don't declare tag in middle
of code.
(scm_i_card_statistics): Add block for declarations of tag_as_scm
and current.
(scm_block_gc, scm_gc_heap_lock): Removed. Removed all uses.
(scm_gc_running_p): Now a macro that refers to the scm_i_thread
field.
(scm_i_sweep_mutex): Now a non-recursive mutex. GC can not happen
recursively.
(scm_igc, scm_i_gc): Renamed former to latter. Changed all uses.
Do not lock scm_i_sweep_mutex, which is now non-recursive, or set
scm_gc_running_p. Do not run the scm_after_gc_c_hook.
(scm_gc): Lock scm_i_sweep_mutex, set scm_gc_running_p and run the
scm_after_gc_c_hook here.
(scm_gc_for_new_cell): Set scm_gc_running_p here and run the
scm_after_gc_c_hook when a full GC has in fact been performed.
(scm_i_expensive_validation_check): Call scm_gc, not scm_i_gc.
* gc-segment.c (scm_i_get_new_heap_segment): Do not check
scm_gc_heap_lock.
* gc-malloc.c (scm_realloc, increase_mtrigger): Set
scm_gc_running_p while the scm_i_sweep_mutex is locked.
(tag_table_to_type_alist): ignore unknown types.
* gc.c (s_scm_gc_live_object_stats): new GUILE callable: return
statistics on the number of live objects of each type.
* gc-card.c (scm_i_tag_name): new function.
(scm_i_card_statistics): new function.
* gc-segment.c (scm_i_all_segments_statistics): new function.
(scm_i_heap_segment_statistics): new function
* gc.c (s_scm_gc_live_object_stats): new GUILE callable: return
statistics on the number of live objects of each type.
* gc-card.c (scm_i_tag_name): new function.
(scm_i_card_statistics): new function.
scm_gc_mallocated, for now.
(scm_init_storage): Initialize it.
* gc-malloc.c (descrease_mtrigger, increase_mtrigger): Use it.
* gc-mark.c (scm_gc_mark_dependencies): Call scm_i_string_mark,
scm_i_stringbuf_mark and scm_i_symbol_mark, as appropriate.
* gc-card.c (scm_i_sweep_card): Call scm_i_string_free,
scm_i_stringbuf_free and scm_i_symbol_free, as appropriate.
(SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with
SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
scm_to_locale_string, etc.
(SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as
above, plus scm_i_get_substring_spec.
* regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c,
hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c,
strorder.c, strports.c, struct.c, symbols.c, unif.c, ports.c: Use
SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH
instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and
SCM_STRING_LENGTH, respectively. Also, replaced scm_return_first
with more explicit scm_remember_upto_here_1, etc, or introduced
them in the first place.
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num,
scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long,
scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num,
scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long):
Discouraged by moving to discouraged.h and discouraged.c and
reimplementing in terms of scm_from_* and scm_to_*. Changed all uses
to the new scm_from_* and scm_to_* functions.
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.
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.
SCM_DEBUG_CELL_ACCESSES is not defined. Scheme source code should
use (if (defined? 'set-debug-cell-accesses!) .. ) to switch on
debugging conditionally.