1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

24 commits

Author SHA1 Message Date
Han-Wen Nienhuys
1f5844000e Style nitpicks: space before () in function call. 2008-08-21 23:16:20 -03:00
Han-Wen Nienhuys
40945e5e9f Add a statistic for tracking how many cells are marked conservatively.
This allows an informed choice for deciding how many segments to
create.  After startup, ~2% of the cells are scanned conservatively.
2008-08-16 15:03:48 -03:00
Han-Wen Nienhuys
82ae1b8eb3 Garbage collection cleanup.
* 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-16 13:57:23 -03:00
Han-Wen Nienhuys
2072309c1c Whitespace and formatting fixes.
Conflicts:

	libguile/gc-freelist.c
	libguile/gc-segment.c
	libguile/gc.h
2008-08-14 01:51:24 -03:00
Ludovic Courtès
d9f71a0754 Changes from arch/CVS synchronization 2006-11-08 09:34:35 +00:00
Kevin Ryde
2b829bbb3d merge from 1.8 branch 2006-04-17 00:05:42 +00:00
Han-Wen Nienhuys
4c7016dc06 Ludovic's patch for scm_t_sweep_statistics. 2006-02-14 11:38:30 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
b17e0ac397 * gc.h, gc.c (SCM_FREECELL_P): Removed for good.
(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-03-10 18:39:53 +00:00
Han-Wen Nienhuys
1367aa5e91 * gc.c (s_scm_gc_live_object_stats): return alist, not hashtable.
* 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.
2005-01-27 22:19:49 +00:00
Marius Vollmer
c17b358f48 (scm_i_get_new_heap_segment): Limit size of new
segment to scm_max_segment_size.
2004-10-19 13:51:22 +00:00
Han-Wen Nienhuys
adba74f3a6 2004-09-13 Jan Nieuwenhuizen <janneke@gnu.org>
* srfi-13.c (scm_string_contains, s_scm_string_contains_ci):
	Bugfix: when subtracting unsigned values, make sure that result
	does not wrap.
2004-09-14 21:10:56 +00:00
Han-Wen Nienhuys
dff96e9567 (snarfcppopts): use DEFAULT_INCLUDES
instead of INCLUDES
2003-04-09 09:29:44 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Han-Wen Nienhuys
dac04e9fb9 * gc-segment.c (scm_i_make_initial_segment): check user settings
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 21:55:33 +00:00
Han-Wen Nienhuys
ffd724008b * struct.h: change scm_structs_to_free to scm_i_structs_to_free
* 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-09-05 21:12:21 +00:00
Han-Wen Nienhuys
1383773ba1 * gc.h: remove DOUBLECELL card flags.
* 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-28 23:13:30 +00:00
Han-Wen Nienhuys
38d1262ab5 (scm_i_get_new_heap_segment): use float in stead of
unsigned numbers for computing minimum heap increment. This
prevents weird results when a a negative minimum increment is computed.
2002-08-25 15:26:14 +00:00
Han-Wen Nienhuys
4a5309c938 (scm_i_get_new_heap_segment): Oops. We want segment
length *at* least SCM_MIN_HEAP_SEG_SIZE, not at most.
2002-08-23 00:05:58 +00:00
Han-Wen Nienhuys
f2893a253e make scm_cells_allocated unsigned again. Thanks to
Bill Schottstaedt for the bug report
2002-08-21 22:40:03 +00:00
Han-Wen Nienhuys
67329a9eef * mallocs.c (scm_malloc_obj): use scm_gc_malloc in stead of
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-16 22:01:10 +00:00
Han-Wen Nienhuys
eab1b25970 * gc.h: add scm_debug_cells_gc_interval to public interface
* 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-08 19:47:31 +00:00
Han-Wen Nienhuys
c2cbcc5768 gc statistic tweaks 2002-08-04 14:09:14 +00:00
Han-Wen Nienhuys
c7743d027a more code 2002-08-04 00:18:33 +00:00