Cyclone Scheme  0.4
Data Structures | Macros | Typedefs | Enumerations | Functions

Major GC is responsible for removing unused objects from the heap. More...

Data Structures

struct  gc_free_list_t
 
struct  gc_header_type_t
 
struct  gc_heap_root_t
 
struct  gc_heap_t
 
struct  gc_thread_data_t
 

Macros

#define DEBUG_SHOW_DIAG   0
 
#define GC_COLLECTION_THRESHOLD   0.05
 
#define gc_color_blue   2
 
#define gc_color_red   0
 
#define GC_DEBUG_SHOW_SWEEP_DIAG   0
 
#define GC_DEBUG_TRACE   0
 
#define GC_DEBUG_VERBOSE   0
 
#define GC_FREE_THRESHOLD   0.40
 
#define GC_SAFETY_CHECKS   0
 
#define grayed(x)   (((list) x)->hdr.grayed)
 
#define GROW_HEAP_BY_SIZE   (2 * 1024 * 1024)
 
#define HEAP_SIZE   (32 * 1024 * 1024)
 
#define INITIAL_HEAP_SIZE   (3 * 1024 * 1024)
 
#define mark(x)   (((list) x)->hdr.mark)
 
#define MAX_STACK_TRACES   10
 
#define NANOSECONDS_PER_MILLISECOND   1000000
 
#define NUM_HEAP_TYPES   (HEAP_HUGE + 1)
 
#define return_thread_runnable(d, r)   gc_mutator_thread_runnable(((gc_thread_data *)d), (r))
 
#define set_thread_blocked(d, c)   gc_mutator_thread_blocked(((gc_thread_data *)d), (c))
 

Typedefs

typedef struct gc_free_list_t gc_free_list
 
typedef struct gc_header_type_t gc_header_type
 
typedef struct gc_heap_t gc_heap
 
typedef struct gc_heap_root_t gc_heap_root
 
typedef struct gc_thread_data_t gc_thread_data
 Each thread is given an instance of this struct to maintain its state. More...
 

Enumerations

enum  cyc_thread_state_type {
  CYC_THREAD_STATE_NEW, CYC_THREAD_STATE_RUNNABLE, CYC_THREAD_STATE_BLOCKED, CYC_THREAD_STATE_BLOCKED_COOPERATING,
  CYC_THREAD_STATE_TERMINATED
}
 
enum  gc_heap_type {
  HEAP_SM = 0, HEAP_64, HEAP_96, HEAP_REST,
  HEAP_HUGE
}
 
enum  gc_stage_type { STAGE_CLEAR_OR_MARKING, STAGE_TRACING, STAGE_SWEEPING, STAGE_RESTING }
 
enum  gc_status_type { STATUS_ASYNC, STATUS_SYNC1, STATUS_SYNC2 }
 

Functions

void gc_add_mutator (gc_thread_data *thd)
 Add data for a new mutator. More...
 
void * gc_alloc (gc_heap_root *h, size_t size, char *obj, gc_thread_data *thd, int *heap_grown)
 
void * gc_alloc_bignum (gc_thread_data *data)
 
size_t gc_allocated_bytes (object obj, gc_free_list *q, gc_free_list *r)
 
void gc_collector_trace ()
 
char * gc_copy_obj (object hp, char *obj, gc_thread_data *thd)
 
void gc_empty_collector_stack ()
 
int gc_grow_heap (gc_heap *h, int heap_type, size_t size, size_t chunk_size, gc_thread_data *thd)
 
void gc_handshake (gc_status_type s)
 
gc_heapgc_heap_create (int heap_type, size_t size, size_t max_size, size_t chunk_size, gc_thread_data *thd)
 Create a new heap page. The caller must hold the necessary locks. More...
 
gc_heapgc_heap_free (gc_heap *page, gc_heap *prev_page)
 Free a page of the heap. More...
 
gc_heapgc_heap_last (gc_heap *h)
 
void gc_heap_merge (gc_heap *hdest, gc_heap *hsrc)
 
size_t gc_heap_total_size (gc_heap *h)
 
void gc_init_heap (long heap_size)
 
void gc_initialize (void)
 Perform one-time initialization before mutators can be executed. More...
 
int gc_is_stack_obj (gc_thread_data *thd, object obj)
 
void gc_mark_globals (object globals, object global_table)
 
void gc_mark_gray (gc_thread_data *thd, object obj)
 
void gc_mark_gray2 (gc_thread_data *thd, object obj)
 
void gc_merge_all_heaps (gc_thread_data *dest, gc_thread_data *src)
 
void gc_mut_cooperate (gc_thread_data *thd, int buf_len)
 
void gc_mut_update (gc_thread_data *thd, object old_obj, object value)
 
void gc_mutator_thread_blocked (gc_thread_data *thd, object cont)
 
void gc_mutator_thread_runnable (gc_thread_data *thd, object result)
 
void gc_post_handshake (gc_status_type s)
 
void gc_print_stats (gc_heap *h)
 
void gc_remove_mutator (gc_thread_data *thd)
 Remove selected mutator from the mutator list. This is done for terminated threads. Note data is queued to be freed, to prevent accidentally freeing it while the collector thread is potentially accessing it. More...
 
void gc_request_mark_globals (void)
 
void gc_start_collector ()
 
size_t gc_sweep (gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd)
 
void gc_thr_add_to_move_buffer (gc_thread_data *d, int *alloci, object obj)
 
void gc_thr_grow_move_buffer (gc_thread_data *d)
 
void gc_thread_data_free (gc_thread_data *thd)
 
void gc_thread_data_init (gc_thread_data *thd, int mut_num, char *stack_base, long stack_size)
 
void * gc_try_alloc (gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd)
 
void gc_wait_handshake ()
 

Detailed Description

Major GC is responsible for removing unused objects from the heap.