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

28 commits

Author SHA1 Message Date
Andy Wingo
cf4c26625b remove CELL_P macro
* libguile/private-gc.h: Remove private CELL_P macro.
2011-10-24 19:00:59 +02:00
Ludovic Courtès
760fb97d1f Remove deprecated variables/macros from the GC headers.
* libguile/deprecated.c (scm_mtrigger, scm_mallocated,
  scm_max_segment_size): New global variables, from gc.c.
  (scm_map_free_list,
  scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New stubs.

* libguile/deprecated.h (scm_mallocated, scm_mtrigger,
  scm_max_segment_size): New declarations.
  (scm_map_free_list,
  scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New
  declarations.

* libguile/gc-malloc.c (scm_i_minyield_malloc): Remove.
  (scm_gc_init_malloc): Remove references to `scm_i_minyield_malloc' and
  `scm_mtrigger'.

* libguile/gc.c (scm_mtrigger, scm_mallocated): Remove.
  (scm_init_storage): Remove reference to `SCM_HEAP_SEG_SIZE'.

* libguile/gc.h (scm_max_segment_size, SCM_SET_FREELIST_LOC,
  SCM_FREELIST_LOC, scm_i_master_freelist, scm_i_master_freelist2,
  scm_mallocated, scm_mtrigger): Remove.
  (scm_map_free_list,
  scm_gc_set_debug_check_freelist_x)[SCM_ENABLE_DEPRECATED &&
  GUILE_DEBUG_FREELIST]: Remove.

* libguile/private-gc.h (SCM_DEFAULT_INIT_HEAP_SIZE_1,
  SCM_DEFAULT_MIN_YIELD_1, SCM_DEFAULT_MIN_YIELD_2,
  DEFAULT_SWEEP_AMOUNT, SCM_DEFAULT_MAX_SEGMENT_SIZE,
  SCM_MIN_HEAP_SEG_SIZE, SCM_HEAP_SEG_SIZE,
  SCM_GC_CARD_BVEC_SIZE_IN_LONGS, SCM_GC_IN_CARD_HEADERP): Remove.
  (scm_getenv_int): Made internal.
  (scm_i_marking, scm_mark_all, scm_i_deprecated_memory_return,
  scm_i_find_heap_calls, scm_gc_init_malloc, scm_gc_init_freelist,
  scm_gc_init_segments, scm_gc_init_mark): Remove declarations.

* libguile/gc-segment-table.c: Remove, finally.
2009-08-28 21:02:42 +02:00
Ludovic Courtès
fbb857a472 Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	lib/Makefile.am
	libguile/Makefile.am
	libguile/frames.c
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc_os_dep.c
	libguile/load.c
	libguile/macros.c
	libguile/objcodes.c
	libguile/programs.c
	libguile/strings.c
	libguile/vm.c
	m4/gnulib-cache.m4
	m4/gnulib-comp.m4
	m4/inline.m4
2009-08-18 00:06:45 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
6cc323e2ff Remove multiple definition of `scm_i_marking'.
* libguile/private-gc.h (scm_i_marking): Turn definition into a
  declaration.
  (scm_mark_all): Mark as `SCM_INTERNAL'.

* libguile/gc-mark.c (scm_i_marking): New definition.
2009-03-26 18:47:28 +01:00
Han-Wen Nienhuys
b71c8ec90a Revise GC asserts.
* libguile/gc.c (scm_i_gc): Change assert into printed warning.

* libguile/private-gc.h (nil): introduce scm_i_last_marked_cell_count,
  as a private mechanism for maintaining cell counts.  Remove variable
  scm_cells_allocated.
2008-09-11 12:10:58 -03:00
Ludovic Courtès
b359b36a63 Fix broken GC and threads merge.
* libguile/private-gc.h (scm_i_tag_name): New declaration.

* libguile/threads.c: Include <config.h>.
2008-09-10 23:33:59 +02:00
Ludovic Courtès
6f03035fe8 Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	libguile/Makefile.am
	libguile/coop-defs.h
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-malloc.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc.c
	libguile/gc.h
	libguile/gc_os_dep.c
	libguile/hashtab.c
	libguile/hashtab.h
	libguile/inline.h
	libguile/private-gc.h
	libguile/struct.c
	libguile/struct.h
	libguile/threads.c
	libguile/threads.h
	libguile/vectors.h
	libguile/weaks.h
	test-suite/tests/gc.test
2008-09-10 23:09:30 +02:00
Ludovic Courtès
4a4849dbe0 Merge commit '0329137392' into boehm-demers-weiser-gc
Conflicts:
	libguile/gc.c
	libguile/srcprop.c
	libguile/srcprop.h
2008-09-10 22:33:40 +02:00
Ludovic Courtès
a8db4a59c8 Use Gnulib's count-one-bits' as a replacement for scm_i_uint_bit_count ()'.
* 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-09-09 22:46:04 +02:00
Ludovic Courtes
26224b3f5d Merge from lcourtes@laas.fr--2005-mobile
Patches applied:

 * lcourtes@laas.fr--2005-mobile/guile-core--boehm-gc--1.9  (base, patch 1)

   - tag of lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--base-0
   - Initial hack for Boehm's GC support: nothing works.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-1
2008-09-05 00:45:58 +02: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
b474ac33ee Remove comments about removed variables. 2008-08-16 13:27:17 -03:00
Han-Wen Nienhuys
d09752ffd1 Introduce scm_i_marking to detect when GC mark bits are touched
outside of marking stage.
2008-08-16 13:21:42 -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
102dbb6f6c Add `SCM_INTERNAL' macro, use it. 2008-05-31 23:21:02 +02:00
Han-Wen Nienhuys
cb90e2cbe7 add FSF header. 2007-01-22 15:11:30 +00:00
Ludovic Courtès
d9f71a0754 Changes from arch/CVS synchronization 2006-11-08 09:34:35 +00:00
Marius Vollmer
d3774e2c7f (CELL_P): Also check that the potential pointer is
correctly aligned for a cell.  Thanks to Miroslav Lichvar!
2006-05-07 22:51:06 +00:00
Han-Wen Nienhuys
4c7016dc06 Ludovic's patch for scm_t_sweep_statistics. 2006-02-14 11:38:30 +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
322a2bf7a0 (SCM_DEFAULT_MAX_SEGMENT_SIZE): Increase to 20 Mib. 2004-10-19 13:53:17 +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
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
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