Cyclone Scheme  0.4
Macros | Functions | Variables
gc.c File Reference
#include <ck_array.h>
#include <ck_pr.h>
#include "cyclone/types.h"
#include <stdint.h>
#include <time.h>

Macros

#define gc_align(n, bits)   (((n)+(1<<(bits))-1)&(((uintptr_t)-1)-((1<<(bits))-1)))
 
#define gc_collector_mark_gray(parent, gobj)
 
#define gc_free_chunk_size   (sizeof(gc_free_list))
 
#define gc_heap_align(n)   gc_align(n, 5)
 
#define gc_heap_end(h)   ((object)((char*)h->data + h->size))
 
#define gc_heap_first_block(h)   ((object)(h->data + gc_heap_align(gc_free_chunk_size)))
 
#define gc_heap_last_block(h)   ((object)((char*)h->data + h->size - gc_heap_align(gc_free_chunk_size)))
 
#define gc_heap_pad_size(s)   (sizeof(struct gc_heap_t) + (s) + gc_heap_align(1))
 
#define gc_mark_black(obj)
 

Functions

void * collector_main (void *arg)
 
void Cyc_apply_from_buf (void *data, int argc, object prim, object *buf)
 
void debug_dump_globals ()
 
void gc_add_mutator (gc_thread_data *thd)
 Add data for a new mutator. More...
 
void * gc_alloc (gc_heap_root *hrt, size_t size, char *obj, gc_thread_data *thd, int *heap_grown)
 
void * gc_alloc_bignum (gc_thread_data *data)
 
void * gc_alloc_from_bignum (gc_thread_data *data, bignum_type *src)
 
size_t gc_allocated_bytes (object obj, gc_free_list *q, gc_free_list *r)
 
void gc_collector ()
 
void gc_collector_sweep ()
 
void gc_collector_trace ()
 
char * gc_copy_obj (object dest, char *obj, gc_thread_data *thd)
 
void gc_empty_collector_stack ()
 
void gc_free_old_thread_data ()
 Free thread data for all terminated mutators. More...
 
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)
 
void gc_initialize (void)
 Perform one-time initialization before mutators can be executed. More...
 
int gc_is_heap_empty (gc_heap *h)
 Determine if a heap page is empty. 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_start_collector ()
 
void gc_sum_pending_writes (gc_thread_data *thd, int locked)
 
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 ()
 
void gc_zero_read_write_counts (gc_thread_data *thd)
 

Variables

ck_array_t Cyc_mutators
 
ck_array_t old_mutators