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

* 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.
This commit is contained in:
Marius Vollmer 2005-03-10 18:39:53 +00:00
parent 94d375b5a7
commit b17e0ac397
4 changed files with 85 additions and 107 deletions

View file

@ -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.
*