diff options
author | Marius Vollmer <mvo@zagadka.de> | 2005-03-10 18:39:53 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2005-03-10 18:39:53 +0000 |
commit | b17e0ac397fbab715704464f35a91745c55e0a1c (patch) | |
tree | 6043dac6c12450e04312fe6e36c8b2f6a94a6209 /libguile/gc-segment.c | |
parent | 94d375b5a77578f636494655afafde29eb7f8972 (diff) | |
download | guile-b17e0ac397fbab715704464f35a91745c55e0a1c.tar.gz |
* 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.
Diffstat (limited to 'libguile/gc-segment.c')
-rw-r--r-- | libguile/gc-segment.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libguile/gc-segment.c b/libguile/gc-segment.c index fee06e7f9..ee87ba73f 100644 --- a/libguile/gc-segment.c +++ b/libguile/gc-segment.c @@ -89,7 +89,7 @@ scm_i_initialize_heap_segment_data (scm_t_heap_segment * segment, size_t request scm_t_cell * memory = 0; /* - We use malloc to alloc the heap. On GNU libc this is + We use calloc to alloc the heap. On GNU libc this is equivalent to mmapping /dev/zero */ SCM_SYSCALL (memory = (scm_t_cell * ) calloc (1, mem_needed)); @@ -320,7 +320,7 @@ SCM scm_i_sweep_some_segments (scm_t_cell_type_statistics * fl) { int i = fl->heap_segment_idx; - SCM collected =SCM_EOL; + SCM collected = SCM_EOL; if (i == -1) i++; @@ -458,19 +458,11 @@ scm_i_find_heap_segment_containing_object (SCM obj) RETURN: the index of the segment. */ int -scm_i_get_new_heap_segment (scm_t_cell_type_statistics *freelist, policy_on_error error_policy) +scm_i_get_new_heap_segment (scm_t_cell_type_statistics *freelist, + policy_on_error error_policy) { size_t len; - if (scm_gc_heap_lock) - { - /* Critical code sections (such as the garbage collector) aren't - * supposed to add heap segments. - */ - fprintf (stderr, "scm_i_get_new_heap_segment: Can not extend locked heap.\n"); - abort (); - } - { /* Assure that the new segment is predicted to be large enough. * |