diff options
author | Ludovic Courtes <ludovic.courtes@laas.fr> | 2006-03-21 22:16:33 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-05 00:45:58 +0200 |
commit | 26224b3f5d795e523e921ec32ffec424893ea035 (patch) | |
tree | d5c47fc98334b4c068610b66435cdce0788f4268 /libguile/private-gc.h | |
parent | 5695ccd43b051caf99f1ca94f00f7231c1466439 (diff) | |
download | guile-26224b3f5d795e523e921ec32ffec424893ea035.tar.gz |
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
Diffstat (limited to 'libguile/private-gc.h')
-rw-r--r-- | libguile/private-gc.h | 176 |
1 files changed, 0 insertions, 176 deletions
diff --git a/libguile/private-gc.h b/libguile/private-gc.h index 8bda190c4..c27196355 100644 --- a/libguile/private-gc.h +++ b/libguile/private-gc.h @@ -78,87 +78,6 @@ int scm_getenv_int (const char *var, int def); typedef enum { return_on_error, abort_on_error } policy_on_error; -/* gc-freelist*/ - -/* - FREELIST: - - 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 - */ - int heap_segment_idx; - - /* minimum yield on this list in order not to grow the heap - */ - long min_yield; - - /* defines min_yield as percent of total heap size - */ - int min_yield_fraction; - - /* number of cells per object on this list */ - int span; - - /* number of collected cells during last GC */ - unsigned long collected; - - /* number of collected cells during penultimate GC */ - unsigned long collected_1; - - /* total number of cells in heap segments - * belonging to this list. - */ - unsigned long heap_size; - - -} scm_t_cell_type_statistics; - - -/* Sweep statistics. */ -typedef struct scm_sweep_statistics -{ - /* Number of cells "swept", i.e., visited during the sweep operation. */ - unsigned swept; - - /* Number of cells collected during the sweep operation. This number must - alsways be lower than or equal to SWEPT. */ - unsigned collected; -} scm_t_sweep_statistics; - -#define scm_i_sweep_statistics_init(_stats) \ - do \ - { \ - (_stats)->swept = (_stats)->collected = 0; \ - } \ - while (0) - -#define scm_i_sweep_statistics_sum(_sum, _addition) \ - do \ - { \ - (_sum)->swept += (_addition).swept; \ - (_sum)->collected += (_addition).collected; \ - } \ - while (0) - - - -extern scm_t_cell_type_statistics scm_i_master_freelist; -extern scm_t_cell_type_statistics scm_i_master_freelist2; -extern unsigned long scm_gc_cells_collected_1; - -void scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist, - scm_t_sweep_statistics sweep_stats); -void 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); - - -#define SCM_HEAP_SIZE \ - (scm_i_master_freelist.heap_size + scm_i_master_freelist2.heap_size) - #define SCM_MAX(A, B) ((A) > (B) ? (A) : (B)) #define SCM_MIN(A, B) ((A) < (B) ? (A) : (B)) @@ -183,103 +102,8 @@ int scm_i_gc_grow_heap_p (scm_t_cell_type_statistics * freelist); 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 -{ - /* - {lower, upper} bounds of the segment - - The upper bound is also the start of the mark space. - */ - scm_t_cell *bounds[2]; - - /* - If we ever decide to give it back, we could do it with this ptr. - - Note that giving back memory is not very useful; as long we don't - touch a chunk of memory, the virtual memory system will keep it - swapped out. We could simply forget about a block. - - (not that we do that, but anyway.) - */ - - void* malloced; - - scm_t_cell * next_free_card; - - /* address of the head-of-freelist pointer for this segment's cells. - All segments usually point to the same one, scm_i_freelist. */ - scm_t_cell_type_statistics *freelist; - - /* number of cells per object in this segment */ - int span; - - - /* - Is this the first time that the cells are accessed? - */ - int first_time; - -} 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; - - -int scm_i_init_card_freelist (scm_t_cell * card, SCM *free_list,scm_t_heap_segment*); -int scm_i_sweep_card (scm_t_cell * card, SCM *free_list, scm_t_heap_segment*); -void scm_i_card_statistics (scm_t_cell *p, SCM hashtab, scm_t_heap_segment *seg); char const *scm_i_tag_name (scm_t_bits tag); /* MOVEME */ -int scm_i_initialize_heap_segment_data (scm_t_heap_segment * segment, size_t requested); -int scm_i_segment_card_count (scm_t_heap_segment * seg); -int scm_i_segment_cell_count (scm_t_heap_segment * seg); - -void scm_i_clear_segment_mark_space (scm_t_heap_segment *seg); -scm_t_heap_segment * scm_i_make_empty_heap_segment (scm_t_cell_type_statistics*); -SCM scm_i_sweep_some_cards (scm_t_heap_segment *seg, - scm_t_sweep_statistics *sweep_stats); -void scm_i_sweep_segment (scm_t_heap_segment *seg, - scm_t_sweep_statistics *sweep_stats); - -void scm_i_heap_segment_statistics (scm_t_heap_segment *seg, SCM tab); - - -int scm_i_insert_segment (scm_t_heap_segment * seg); -long int scm_i_find_heap_segment_containing_object (SCM obj); -int scm_i_get_new_heap_segment (scm_t_cell_type_statistics *, policy_on_error); -void scm_i_clear_mark_space (void); -void scm_i_sweep_segments (void); -SCM scm_i_sweep_some_segments (scm_t_cell_type_statistics *fl, - scm_t_sweep_statistics *sweep_stats); -void scm_i_reset_segments (void); -void scm_i_sweep_all_segments (char const *reason, - scm_t_sweep_statistics *sweep_stats); -SCM scm_i_all_segments_statistics (SCM hashtab); -void scm_i_make_initial_segment (int init_heap_size, scm_t_cell_type_statistics *freelist); extern long int scm_i_deprecated_memory_return; |