mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Whitespace and formatting fixes.
Conflicts: libguile/gc-freelist.c libguile/gc-segment.c libguile/gc.h
This commit is contained in:
parent
c95514b3b4
commit
2072309c1c
4 changed files with 8 additions and 39 deletions
|
@ -26,9 +26,6 @@
|
|||
scm_t_cell_type_statistics scm_i_master_freelist;
|
||||
scm_t_cell_type_statistics scm_i_master_freelist2;
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
In older versions of GUILE GC there was extensive support for
|
||||
|
@ -38,8 +35,6 @@ the list. Mark bits are now separate, and checking for sane cell
|
|||
access can be done much more easily by simply checking if the mark bit
|
||||
is unset before allocation. --hwn
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#if (SCM_ENABLE_DEPRECATED == 1)
|
||||
|
@ -69,9 +64,6 @@ SCM_DEFINE (scm_gc_set_debug_check_freelist_x, "gc-set-debug-check-freelist!", 1
|
|||
#endif /* defined (GUILE_DEBUG) */
|
||||
#endif /* deprecated */
|
||||
|
||||
|
||||
|
||||
|
||||
/* Adjust FREELIST variables to decide wether or not to allocate more heap in
|
||||
the next GC run based on SWEEP_STATS on SWEEP_STATS_1 (statistics
|
||||
collected after the two last full GC). */
|
||||
|
@ -156,7 +148,6 @@ scm_gc_init_freelist (void)
|
|||
if (scm_max_segment_size <= 0)
|
||||
scm_max_segment_size = SCM_DEFAULT_MAX_SEGMENT_SIZE;
|
||||
|
||||
|
||||
scm_i_make_initial_segment (init_heap_size_1, &scm_i_master_freelist);
|
||||
scm_i_make_initial_segment (init_heap_size_2, &scm_i_master_freelist2);
|
||||
|
||||
|
@ -188,5 +179,6 @@ scm_i_gc_sweep_freelist_reset (scm_t_cell_type_statistics *freelist)
|
|||
int
|
||||
scm_i_gc_grow_heap_p (scm_t_cell_type_statistics * freelist)
|
||||
{
|
||||
return SCM_MAX (freelist->collected,freelist->collected_1) < freelist->min_yield;
|
||||
return SCM_MAX (freelist->collected, freelist->collected_1)
|
||||
< freelist->min_yield;
|
||||
}
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
#include "libguile/gc.h"
|
||||
#include "libguile/private-gc.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
size_t scm_max_segment_size;
|
||||
|
||||
scm_t_heap_segment *
|
||||
|
@ -63,8 +59,6 @@ scm_i_heap_segment_statistics (scm_t_heap_segment *seg, SCM tab)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Fill SEGMENT with memory both for data and mark bits.
|
||||
|
||||
|
@ -387,9 +381,6 @@ scm_i_all_segments_statistics (SCM tab)
|
|||
return tab;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Determine whether the given value does actually represent a cell in
|
||||
some heap segment. If this is the case, the number of the heap
|
||||
|
@ -494,13 +485,14 @@ scm_i_get_new_heap_segment (scm_t_cell_type_statistics *freelist,
|
|||
float min_cells = (f * h - sweep_stats.collected) / (1.0 - f);
|
||||
|
||||
/* Make heap grow with factor 1.5 */
|
||||
len = freelist->heap_size / 2;
|
||||
len = freelist->heap_size / 2;
|
||||
#ifdef DEBUGINFO
|
||||
fprintf (stderr, "(%ld < %ld)", (long) len, (long) min_cells);
|
||||
#endif
|
||||
|
||||
|
||||
if (len < min_cells)
|
||||
len = (unsigned long) min_cells;
|
||||
len = (unsigned long) min_cells;
|
||||
|
||||
len *= sizeof (scm_t_cell);
|
||||
/* force new sampling */
|
||||
freelist->collected = LONG_MAX;
|
||||
|
@ -508,6 +500,7 @@ scm_i_get_new_heap_segment (scm_t_cell_type_statistics *freelist,
|
|||
|
||||
if (len > scm_max_segment_size)
|
||||
len = scm_max_segment_size;
|
||||
|
||||
if (len < SCM_MIN_HEAP_SEG_SIZE)
|
||||
len = SCM_MIN_HEAP_SEG_SIZE;
|
||||
|
||||
|
@ -541,7 +534,7 @@ scm_i_make_initial_segment (int init_heap_size, scm_t_cell_type_statistics *free
|
|||
|
||||
if (init_heap_size < 1)
|
||||
{
|
||||
init_heap_size = SCM_DEFAULT_INIT_HEAP_SIZE_1;
|
||||
init_heap_size = SCM_DEFAULT_INIT_HEAP_SIZE_1;
|
||||
}
|
||||
|
||||
if (scm_i_initialize_heap_segment_data (seg, init_heap_size))
|
||||
|
|
|
@ -543,7 +543,6 @@ scm_gc_for_newcell (scm_t_cell_type_statistics *freelist, SCM *free_cells)
|
|||
/*
|
||||
out of fresh cells. Try to get some new ones.
|
||||
*/
|
||||
|
||||
did_gc = 1;
|
||||
scm_i_gc ("cells");
|
||||
|
||||
|
|
|
@ -73,12 +73,9 @@
|
|||
|
||||
#define SCM_DEFAULT_MAX_SEGMENT_SIZE (20*1024*1024L)
|
||||
|
||||
|
||||
|
||||
#define SCM_MIN_HEAP_SEG_SIZE (8 * SCM_GC_SIZEOF_CARD)
|
||||
#define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_t_cell))
|
||||
|
||||
|
||||
#define SCM_DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0)
|
||||
|
||||
|
||||
|
@ -101,7 +98,6 @@ typedef enum { return_on_error, abort_on_error } policy_on_error;
|
|||
A struct holding GC statistics on a particular type of cells.
|
||||
*/
|
||||
typedef struct scm_t_cell_type_statistics {
|
||||
|
||||
/*
|
||||
heap segment where the last cell was allocated
|
||||
*/
|
||||
|
@ -195,25 +191,17 @@ int scm_i_gc_grow_heap_p (scm_t_cell_type_statistics * freelist);
|
|||
/*
|
||||
gc-mark
|
||||
*/
|
||||
|
||||
|
||||
void scm_mark_all (void);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
gc-segment:
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Cells are stored in a heap-segment: it is a contiguous chunk of
|
||||
memory, that associated with one freelist.
|
||||
*/
|
||||
|
||||
typedef struct scm_t_heap_segment
|
||||
{
|
||||
/*
|
||||
|
@ -255,12 +243,10 @@ typedef struct scm_t_heap_segment
|
|||
|
||||
|
||||
/*
|
||||
|
||||
A table of segment records is kept that records the upper and
|
||||
lower extents of the segment; this is used during the conservative
|
||||
phase of gc to identify probably gc roots (because they point
|
||||
into valid segments at reasonable offsets).
|
||||
|
||||
*/
|
||||
extern scm_t_heap_segment ** scm_i_heap_segment_table;
|
||||
extern size_t scm_i_heap_segment_table_size;
|
||||
|
@ -309,7 +295,6 @@ SCM_INTERNAL void scm_i_make_initial_segment (int init_heap_size,
|
|||
|
||||
extern long int scm_i_deprecated_memory_return;
|
||||
|
||||
|
||||
/*
|
||||
global init funcs.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue