summaryrefslogtreecommitdiff
path: root/libguile/gc-segment.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+1
2008-09-09Use Gnulib's `count-one-bits' as a replacement for `scm_i_uint_bit_count ()'.Ludovic Courtès1-2/+8
* 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.
2008-08-21Fix 2 indentation nitpicks.Han-Wen Nienhuys1-4/+5
2008-08-21Style nitpicks: space before () in function call.Han-Wen Nienhuys1-1/+1
2008-08-16Add a statistic for tracking how many cells are marked conservatively.Han-Wen Nienhuys1-0/+1
This allows an informed choice for deciding how many segments to create. After startup, ~2% of the cells are scanned conservatively.
2008-08-16Garbage collection cleanup.Han-Wen Nienhuys1-415/+130
* 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.
2008-08-14Whitespace and formatting fixes.Han-Wen Nienhuys1-13/+6
Conflicts: libguile/gc-freelist.c libguile/gc-segment.c libguile/gc.h
2006-11-08Changes from arch/CVS synchronizationLudovic Courtès1-12/+14
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2006-02-14Ludovic's patch for scm_t_sweep_statistics.Han-Wen Nienhuys1-37/+46
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-03-10* gc.h, gc.c (SCM_FREECELL_P): Removed for good.Marius Vollmer1-12/+4
(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.
2005-01-27* gc.c (s_scm_gc_live_object_stats): return alist, not hashtable.Han-Wen Nienhuys1-2/+33
* 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.
2004-10-19(scm_i_get_new_heap_segment): Limit size of newMarius Vollmer1-0/+2
segment to scm_max_segment_size.
2004-09-142004-09-13 Jan Nieuwenhuizen <janneke@gnu.org>Han-Wen Nienhuys1-1/+1
* srfi-13.c (scm_string_contains, s_scm_string_contains_ci): Bugfix: when subtracting unsigned values, make sure that result does not wrap.
2003-04-09(snarfcppopts): use DEFAULT_INCLUDESHan-Wen Nienhuys1-0/+2
instead of INCLUDES
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-35/+11
2002-09-05* gc-segment.c (scm_i_make_initial_segment): check user settingsHan-Wen Nienhuys1-3/+6
for sanity. * gc-malloc.c (scm_gc_init_malloc): check user settings for sanity. (scm_gc_register_collectable_memory): prevent overflow of memory counts. * gc-freelist.c (scm_init_freelist): check user settings for sanity. * gc-malloc.c (scm_gc_register_collectable_memory): use floats; these won't ever wrap around with high memory usage. * gc-freelist.c: include <stdio.h> * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2002-09-05* struct.h: change scm_structs_to_free to scm_i_structs_to_freeHan-Wen Nienhuys1-1/+12
* gc-malloc.c (scm_gc_register_collectable_memory): use floats; these won't ever wrap around with high memory usage. * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2002-08-28* gc.h: remove DOUBLECELL card flags.Han-Wen Nienhuys1-27/+9
* gc-malloc.c (scm_calloc): try to use calloc() before calling scm_realloc(). * gc-segment.c (scm_i_initialize_heap_segment_data): remove card init loop; handle this from scm_init_card_freelist() * gc-card.c (scm_init_card_freelist): init bit vector here.
2002-08-25(scm_i_get_new_heap_segment): use float in stead ofHan-Wen Nienhuys1-16/+5
unsigned numbers for computing minimum heap increment. This prevents weird results when a a negative minimum increment is computed.
2002-08-23(scm_i_get_new_heap_segment): Oops. We want segmentHan-Wen Nienhuys1-1/+1
length *at* least SCM_MIN_HEAP_SEG_SIZE, not at most.
2002-08-21make scm_cells_allocated unsigned again. Thanks toHan-Wen Nienhuys1-1/+1
Bill Schottstaedt for the bug report
2002-08-16* mallocs.c (scm_malloc_obj): use scm_gc_malloc in stead ofHan-Wen Nienhuys1-10/+3
malloc. * gc-segment.c (scm_i_get_new_heap_segment): remove cluster cruft: only use SCM_MIN_HEAP_SEG_SIZE. * ports.c (scm_add_to_port_table): add backwards compatibility function * ports.h: use scm_i_ prefix for port table and port table size.
2002-08-08* gc.h: add scm_debug_cells_gc_interval to public interfaceHan-Wen Nienhuys1-1/+1
* gc-card.c ("sweep_card"): set scm_gc_running while sweeping. * gc.c (scm_i_expensive_validation_check): separate expensive validation checks from cheap ones.
2002-08-04gc statistic tweaksHan-Wen Nienhuys1-3/+12
2002-08-04 more codeHan-Wen Nienhuys1-0/+562