diff --git a/c-api/gc_8c.html b/c-api/gc_8c.html index b558f3b6..32bb985c 100644 --- a/c-api/gc_8c.html +++ b/c-api/gc_8c.html @@ -79,6 +79,7 @@ Macros #define gc_align(n, bits)   (((n)+(1<<(bits))-1)&(((uintptr_t)-1)-((1<<(bits))-1)))   #define gc_collector_mark_gray(parent, gobj) + "Color" objects gray by adding them to the mark stack for further processing. More...
  #define gc_free_chunk_size   (sizeof(gc_free_list))   @@ -107,29 +108,40 @@ Functions  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) + Allocate memory on the heap for an object. More...
  void * gc_alloc_bignum (gc_thread_data *data) + A convenience function for allocating bignums. More...
  void * gc_alloc_from_bignum (gc_thread_data *data, bignum_type *src) + A helper function to create a heap-allocated copy of a bignum. More...
  size_t gc_allocated_bytes (object obj, gc_free_list *q, gc_free_list *r) + Get the number of bytes that will be allocated for obj. More...
  void gc_collector () + Main collector function. More...
  void gc_collector_sweep () + A convenient front-end to the actual gc_sweep function. More...
  void gc_collector_trace () + The collector's tracing algorithm. More...
  char * gc_copy_obj (object dest, char *obj, gc_thread_data *thd) + Copy given object into given heap object. More...
  void gc_empty_collector_stack () + Empty the collector's mark stack. More...
  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) + Grow a heap by allocating a new page. More...
  void gc_handshake (gc_status_type s) + Called by the collector thread to perform a handshake with all of the mutators. More...
  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...
@@ -138,8 +150,10 @@ Functions  Free a page of the heap. More...
  gc_heapgc_heap_last (gc_heap *h) + Get the heap's last page. More...
  void gc_heap_merge (gc_heap *hdest, gc_heap *hsrc) + Merge one heap into another. More...
  void gc_initialize (void)  Perform one-time initialization before mutators can be executed. More...
@@ -148,49 +162,70 @@ Functions  Determine if a heap page is empty. More...
  int gc_is_stack_obj (gc_thread_data *thd, object obj) + Determine if object lives on the thread's stack. More...
  void gc_mark_globals (object globals, object global_table) + Mark globals as part of the tracing collector. More...
  void gc_mark_gray (gc_thread_data *thd, object obj) + Mark the given object gray if it is on the heap. More...
  void gc_mark_gray2 (gc_thread_data *thd, object obj) + Add a pending write to the mark buffer. More...
  void gc_merge_all_heaps (gc_thread_data *dest, gc_thread_data *src) + Merge all thread heaps into another. More...
  void gc_mut_cooperate (gc_thread_data *thd, int buf_len) + Called by a mutator to cooperate with the collector thread. More...
  void gc_mut_update (gc_thread_data *thd, object old_obj, object value) + Write barrier for updates to heap-allocated objects. More...
  void gc_mutator_thread_blocked (gc_thread_data *thd, object cont) + Called explicitly from a mutator thread to let the collector know it (may) block for an unknown period of time. More...
  void gc_mutator_thread_runnable (gc_thread_data *thd, object result) + Called explicitly from a mutator thread to let the collector know that it has finished blocking. More...
  void gc_post_handshake (gc_status_type s) + Change GC status to the given type. More...
  void gc_print_stats (gc_heap *h) + Print heap usage information. Before calling this function the current thread must have the heap lock. More...
  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 () + Spawn the collector thread. More...
  void gc_sum_pending_writes (gc_thread_data *thd, int locked) + Move pending writes to 'last_write'. More...
  size_t gc_sweep (gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd) + Sweep portion of the GC algorithm. More...
  void gc_thr_add_to_move_buffer (gc_thread_data *d, int *alloci, object obj) + Add an object to the move buffer. More...
  void gc_thr_grow_move_buffer (gc_thread_data *d) + Increase the size of the mutator's move buffer. More...
  void gc_thread_data_free (gc_thread_data *thd) + Free all data for the given mutator. More...
  void gc_thread_data_init (gc_thread_data *thd, int mut_num, char *stack_base, long stack_size) + Initialize runtime data structures for a thread. More...
  void * gc_try_alloc (gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd) + Attempt to allocate a new heap slot for the given object. More...
  void gc_wait_handshake () + Wait for all mutators to handshake. More...
  void gc_zero_read_write_counts (gc_thread_data *thd) + Clear thread data read/write fields. More...
  diff --git a/c-api/gc_8c_a3fd0cf1889f90874133c0eb94866180c.html b/c-api/gc_8c_a3fd0cf1889f90874133c0eb94866180c.html index 589ffcbe..98406608 100644 --- a/c-api/gc_8c_a3fd0cf1889f90874133c0eb94866180c.html +++ b/c-api/gc_8c_a3fd0cf1889f90874133c0eb94866180c.html @@ -143,7 +143,14 @@ $(function() {

diff --git a/c-api/gc_8c_a098c8f133063f61acf0ea4f61e02f759.html b/c-api/gc_8c_a098c8f133063f61acf0ea4f61e02f759.html index 38fd623f..a1366d20 100644 --- a/c-api/gc_8c_a098c8f133063f61acf0ea4f61e02f759.html +++ b/c-api/gc_8c_a098c8f133063f61acf0ea4f61e02f759.html @@ -157,6 +157,16 @@ $(function() {
#define is_object_type(x)
Definition: types.h:490
void ** vpbuffer_add(void **buf, int *len, int i, void *obj)
Definition: runtime.c:5438
+

"Color" objects gray by adding them to the mark stack for further processing.

+
Parameters
+ + + +
parentParent of object, used for debugging only
objObject to mark
+
+
+

Note that stack objects are always colored red during creation, so they should never be added to the mark stack. Which would be bad because it could lead to stack corruption.

+

-

Clear thread data read/write fields

+ +

Clear thread data read/write fields.

+
Parameters
+ + +
thdMutator's thread data object
+
+
diff --git a/c-api/gc_8c_a9f542dda06a1a342304c570baf6347a0.html b/c-api/gc_8c_a9f542dda06a1a342304c570baf6347a0.html index 87c4b34e..51326bcb 100644 --- a/c-api/gc_8c_a9f542dda06a1a342304c570baf6347a0.html +++ b/c-api/gc_8c_a9f542dda06a1a342304c570baf6347a0.html @@ -154,6 +154,16 @@ $(function() {
+

A helper function to create a heap-allocated copy of a bignum.

+
Parameters
+ + + +
dataThe mutator's thread data object
srcThe bignum instance to copy to the heap
+
+
+
Returns
Pointer to the heap object
+
diff --git a/c-api/gc_8c_ab08135ec4278369570fa94a56283bbb1.html b/c-api/gc_8c_ab08135ec4278369570fa94a56283bbb1.html index 2706440e..d99b98f4 100644 --- a/c-api/gc_8c_ab08135ec4278369570fa94a56283bbb1.html +++ b/c-api/gc_8c_ab08135ec4278369570fa94a56283bbb1.html @@ -143,6 +143,8 @@ $(function() {
+

A convenient front-end to the actual gc_sweep function.

+
diff --git a/c-api/gc_8c_ad8f6f6f44acdb47b0ef6451f9822377e.html b/c-api/gc_8c_ad8f6f6f44acdb47b0ef6451f9822377e.html index 3672e2dd..c1c402ad 100644 --- a/c-api/gc_8c_ad8f6f6f44acdb47b0ef6451f9822377e.html +++ b/c-api/gc_8c_ad8f6f6f44acdb47b0ef6451f9822377e.html @@ -143,6 +143,8 @@ $(function() {
+

Main collector function.

+
diff --git a/c-api/gc_8c_ae989c655a69c574af497e996f27e6cae.html b/c-api/gc_8c_ae989c655a69c574af497e996f27e6cae.html index ec5ebab0..b81d6c9b 100644 --- a/c-api/gc_8c_ae989c655a69c574af497e996f27e6cae.html +++ b/c-api/gc_8c_ae989c655a69c574af497e996f27e6cae.html @@ -153,7 +153,15 @@ $(function() {
-

Move pending writes to last_write

+ +

Move pending writes to 'last_write'.

+
Parameters
+ + + +
thdMutator's thread data object
lockedDoes the caller hold the mutator lock?
+
+
diff --git a/c-api/group__gc__major.html b/c-api/group__gc__major.html index bc2b3678..293f4e3e 100644 --- a/c-api/group__gc__major.html +++ b/c-api/group__gc__major.html @@ -182,20 +182,28 @@ Functions  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) + Allocate memory on the heap for an object. More...
  void * gc_alloc_bignum (gc_thread_data *data) + A convenience function for allocating bignums. More...
  size_t gc_allocated_bytes (object obj, gc_free_list *q, gc_free_list *r) + Get the number of bytes that will be allocated for obj. More...
  void gc_collector_trace () + The collector's tracing algorithm. More...
  char * gc_copy_obj (object hp, char *obj, gc_thread_data *thd) + Copy given object into given heap object. More...
  void gc_empty_collector_stack () + Empty the collector's mark stack. More...
  int gc_grow_heap (gc_heap *h, int heap_type, size_t size, size_t chunk_size, gc_thread_data *thd) + Grow a heap by allocating a new page. More...
  void gc_handshake (gc_status_type s) + Called by the collector thread to perform a handshake with all of the mutators. More...
  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...
@@ -204,8 +212,10 @@ Functions  Free a page of the heap. More...
  gc_heapgc_heap_last (gc_heap *h) + Get the heap's last page. More...
  void gc_heap_merge (gc_heap *hdest, gc_heap *hsrc) + Merge one heap into another. More...
  size_t gc_heap_total_size (gc_heap *h)   @@ -215,26 +225,37 @@ Functions  Perform one-time initialization before mutators can be executed. More...
  int gc_is_stack_obj (gc_thread_data *thd, object obj) + Determine if object lives on the thread's stack. More...
  void gc_mark_globals (object globals, object global_table) + Mark globals as part of the tracing collector. More...
  void gc_mark_gray (gc_thread_data *thd, object obj) + Mark the given object gray if it is on the heap. More...
  void gc_mark_gray2 (gc_thread_data *thd, object obj) + Add a pending write to the mark buffer. More...
  void gc_merge_all_heaps (gc_thread_data *dest, gc_thread_data *src) + Merge all thread heaps into another. More...
  void gc_mut_cooperate (gc_thread_data *thd, int buf_len) + Called by a mutator to cooperate with the collector thread. More...
  void gc_mut_update (gc_thread_data *thd, object old_obj, object value) + Write barrier for updates to heap-allocated objects. More...
  void gc_mutator_thread_blocked (gc_thread_data *thd, object cont) + Called explicitly from a mutator thread to let the collector know it (may) block for an unknown period of time. More...
  void gc_mutator_thread_runnable (gc_thread_data *thd, object result) + Called explicitly from a mutator thread to let the collector know that it has finished blocking. More...
  void gc_post_handshake (gc_status_type s) + Change GC status to the given type. More...
  void gc_print_stats (gc_heap *h) + Print heap usage information. Before calling this function the current thread must have the heap lock. More...
  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...
@@ -242,20 +263,28 @@ Functions void gc_request_mark_globals (void)   void gc_start_collector () + Spawn the collector thread. More...
  size_t gc_sweep (gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd) + Sweep portion of the GC algorithm. More...
  void gc_thr_add_to_move_buffer (gc_thread_data *d, int *alloci, object obj) + Add an object to the move buffer. More...
  void gc_thr_grow_move_buffer (gc_thread_data *d) + Increase the size of the mutator's move buffer. More...
  void gc_thread_data_free (gc_thread_data *thd) + Free all data for the given mutator. More...
  void gc_thread_data_init (gc_thread_data *thd, int mut_num, char *stack_base, long stack_size) + Initialize runtime data structures for a thread. More...
  void * gc_try_alloc (gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd) + Attempt to allocate a new heap slot for the given object. More...
  void gc_wait_handshake () + Wait for all mutators to handshake. More...
 

Detailed Description

diff --git a/c-api/group__gc__major_ga15186c504a0fb0727cd7d405b0b2d9a5.html b/c-api/group__gc__major_ga15186c504a0fb0727cd7d405b0b2d9a5.html index f4e24147..4e204207 100644 --- a/c-api/group__gc__major_ga15186c504a0fb0727cd7d405b0b2d9a5.html +++ b/c-api/group__gc__major_ga15186c504a0fb0727cd7d405b0b2d9a5.html @@ -148,7 +148,7 @@ $(function() { char* gc_copy_obj ( object  - hp, + dest, @@ -170,6 +170,18 @@ $(function() {
+

Copy given object into given heap object.

+
Parameters
+ + + + +
destPointer to destination heap memory slot
objObject to copy
thdThread data object for the applicable mutator
+
+
+
Returns
The appropriate pointer to use for obj
+

NOTE: There is no additional type checking because this function is called from gc_move which already does that.

+
diff --git a/c-api/group__gc__major_ga2031d7ff5d1678d2aa7954c5fa3b989e.html b/c-api/group__gc__major_ga2031d7ff5d1678d2aa7954c5fa3b989e.html index ee878514..66aa79aa 100644 --- a/c-api/group__gc__major_ga2031d7ff5d1678d2aa7954c5fa3b989e.html +++ b/c-api/group__gc__major_ga2031d7ff5d1678d2aa7954c5fa3b989e.html @@ -163,7 +163,16 @@ $(function() {
-

Merge all thread heaps into another. Assumes appropriate locks are already held.

+ +

Merge all thread heaps into another.

+
Parameters
+ + + +
destHeap receiving new pages
srcHeap containing pages to be appended
+
+
+

Assumes appropriate locks are already held.

diff --git a/c-api/group__gc__major_ga20cf7c4fac92c3cb1adb025813ea2a99.html b/c-api/group__gc__major_ga20cf7c4fac92c3cb1adb025813ea2a99.html index 83fadcf9..e35482cb 100644 --- a/c-api/group__gc__major_ga20cf7c4fac92c3cb1adb025813ea2a99.html +++ b/c-api/group__gc__major_ga20cf7c4fac92c3cb1adb025813ea2a99.html @@ -154,6 +154,14 @@ $(function() {
+

Called by the collector thread to perform a handshake with all of the mutators.

+
Parameters
+ + +
sTransition to this GC status
+
+
+
diff --git a/c-api/group__gc__major_ga2118e3b31300a7ddcd96c95e218f862e.html b/c-api/group__gc__major_ga2118e3b31300a7ddcd96c95e218f862e.html index 9403a4d1..345ce39b 100644 --- a/c-api/group__gc__major_ga2118e3b31300a7ddcd96c95e218f862e.html +++ b/c-api/group__gc__major_ga2118e3b31300a7ddcd96c95e218f862e.html @@ -153,7 +153,14 @@ $(function() {
-

Print heap usage information. Before calling this function the current thread must have the heap lock

+ +

Print heap usage information. Before calling this function the current thread must have the heap lock.

+
Parameters
+ + +
hHeap to analyze.
+
+
diff --git a/c-api/group__gc__major_ga2f62288e6f57fe9fbff4bae5bd782e44.html b/c-api/group__gc__major_ga2f62288e6f57fe9fbff4bae5bd782e44.html index 69fd2b5b..5e7c62cf 100644 --- a/c-api/group__gc__major_ga2f62288e6f57fe9fbff4bae5bd782e44.html +++ b/c-api/group__gc__major_ga2f62288e6f57fe9fbff4bae5bd782e44.html @@ -170,6 +170,17 @@ $(function() {
+

Get the number of bytes that will be allocated for obj.

+
Parameters
+ + + + +
objObject to inspect
qPrevious free list pointer, set to NULL if not applicable
rNext free list pointer, set to NULL if not applicable
+
+
+
Returns
Number of bytes, including any needed for alignment
+
diff --git a/c-api/group__gc__major_ga34834cdbd4e4f511ad8e918f0fb2d765.html b/c-api/group__gc__major_ga34834cdbd4e4f511ad8e918f0fb2d765.html index 5ed4929c..81d163af 100644 --- a/c-api/group__gc__major_ga34834cdbd4e4f511ad8e918f0fb2d765.html +++ b/c-api/group__gc__major_ga34834cdbd4e4f511ad8e918f0fb2d765.html @@ -170,6 +170,16 @@ $(function() {
+

Add an object to the move buffer.

+
Parameters
+ + + + +
dMutator data object containing the buffer
allociPointer to the next open slot in the buffer
objObject to add
+
+
+
diff --git a/c-api/group__gc__major_ga46bc54c66f56b0006420ce310c2729c1.html b/c-api/group__gc__major_ga46bc54c66f56b0006420ce310c2729c1.html index 8140e3b2..a3543c6e 100644 --- a/c-api/group__gc__major_ga46bc54c66f56b0006420ce310c2729c1.html +++ b/c-api/group__gc__major_ga46bc54c66f56b0006420ce310c2729c1.html @@ -154,6 +154,14 @@ $(function() {
+

Increase the size of the mutator's move buffer.

+
Parameters
+ + +
dMutator's thread data object
+
+
+
diff --git a/c-api/group__gc__major_ga4c76104f4bb633c0594334508f8a19b1.html b/c-api/group__gc__major_ga4c76104f4bb633c0594334508f8a19b1.html index 822b094e..e401a5b0 100644 --- a/c-api/group__gc__major_ga4c76104f4bb633c0594334508f8a19b1.html +++ b/c-api/group__gc__major_ga4c76104f4bb633c0594334508f8a19b1.html @@ -153,6 +153,9 @@ $(function() {
+

Empty the collector's mark stack.

+

Objects on the stack are removed one at a time and marked

+
diff --git a/c-api/group__gc__major_ga51690b332091995ffd5c7318f569f934.html b/c-api/group__gc__major_ga51690b332091995ffd5c7318f569f934.html index 812bb448..5fae3017 100644 --- a/c-api/group__gc__major_ga51690b332091995ffd5c7318f569f934.html +++ b/c-api/group__gc__major_ga51690b332091995ffd5c7318f569f934.html @@ -153,6 +153,9 @@ $(function() {
+

Wait for all mutators to handshake.

+

This function is always called by the collector. If a mutator is blocked and cannot handshake, the collector will cooperate on its behalf, including invoking a minor GC of the mutator's stack, so major GC can proceed.

+
diff --git a/c-api/group__gc__major_ga63112677a59a58464bc08d5ef2a91c6c.html b/c-api/group__gc__major_ga63112677a59a58464bc08d5ef2a91c6c.html index 1fbca9be..f1664519 100644 --- a/c-api/group__gc__major_ga63112677a59a58464bc08d5ef2a91c6c.html +++ b/c-api/group__gc__major_ga63112677a59a58464bc08d5ef2a91c6c.html @@ -154,6 +154,14 @@ $(function() {
+

Change GC status to the given type.

+
Parameters
+ + +
sTransition to this GC status
+
+
+
diff --git a/c-api/group__gc__major_ga6490c2be516744d1cdc225b9ef2688ca.html b/c-api/group__gc__major_ga6490c2be516744d1cdc225b9ef2688ca.html index 006b7fb3..240475cf 100644 --- a/c-api/group__gc__major_ga6490c2be516744d1cdc225b9ef2688ca.html +++ b/c-api/group__gc__major_ga6490c2be516744d1cdc225b9ef2688ca.html @@ -163,7 +163,16 @@ $(function() {
-

Determine if object lives on the thread's stack

+ +

Determine if object lives on the thread's stack.

+
Parameters
+ + + +
thdMutator's thread data
objObject to inspect
+
+
+
Returns
True if obj is on the mutator's stack, false otherwise
diff --git a/c-api/group__gc__major_ga6934bc689d9c64df40d96fbd4db8cbd7.html b/c-api/group__gc__major_ga6934bc689d9c64df40d96fbd4db8cbd7.html index f3e1079b..cd9367ac 100644 --- a/c-api/group__gc__major_ga6934bc689d9c64df40d96fbd4db8cbd7.html +++ b/c-api/group__gc__major_ga6934bc689d9c64df40d96fbd4db8cbd7.html @@ -182,6 +182,20 @@ $(function() {
+

Attempt to allocate a new heap slot for the given object.

+
Parameters
+ + + + + + +
hHeap to allocate from
heap_typeDefine the size of objects that will be allocated on this heap
sizeSize of the requested object, in bytes
objObject containing data that will be copied to the heap
thdThread data for the mutator using this heap
+
+
+
Returns
Pointer to the newly-allocated object, or NULL if allocation failed
+

This function will fail if there is no space on the heap for the requested object.

+
diff --git a/c-api/group__gc__major_ga6a88578b8802b9bca9f56e0ccfdff435.html b/c-api/group__gc__major_ga6a88578b8802b9bca9f56e0ccfdff435.html index 34b495f4..5cae2b6d 100644 --- a/c-api/group__gc__major_ga6a88578b8802b9bca9f56e0ccfdff435.html +++ b/c-api/group__gc__major_ga6a88578b8802b9bca9f56e0ccfdff435.html @@ -164,6 +164,16 @@ $(function() {
+

Called by a mutator to cooperate with the collector thread.

+
Parameters
+ + + +
thdMutator's thread data
buf_lenNumber of objects moved to the heap by the mutator during minor GC
+
+
+

This function must be called periodically by each mutator to coordinate with the collector. In our implementation it is called after minor GC.

+
diff --git a/c-api/group__gc__major_ga7f1dfa939185ca0cf6d194c991000185.html b/c-api/group__gc__major_ga7f1dfa939185ca0cf6d194c991000185.html index 198a53a8..2659cb20 100644 --- a/c-api/group__gc__major_ga7f1dfa939185ca0cf6d194c991000185.html +++ b/c-api/group__gc__major_ga7f1dfa939185ca0cf6d194c991000185.html @@ -154,6 +154,16 @@ $(function() {
+

Get the heap's last page.

+
Parameters
+ + +
hHeap to inspect
+
+
+
Returns
Pointer to the heap's last page
+

This function does not do any locking, it is the responsibility of the caller to hold the appropriate locks prior to calling.

+
diff --git a/c-api/group__gc__major_ga7fac46df80136375f0aabd3af30a8874.html b/c-api/group__gc__major_ga7fac46df80136375f0aabd3af30a8874.html index a56f7f17..b097cf00 100644 --- a/c-api/group__gc__major_ga7fac46df80136375f0aabd3af30a8874.html +++ b/c-api/group__gc__major_ga7fac46df80136375f0aabd3af30a8874.html @@ -163,7 +163,16 @@ $(function() {
-

Add a pending write to the mark buffer. These are pended because they are written in a batch during minor GC. To prevent race conditions we wait until all of the writes are made before updating last write.

+ +

Add a pending write to the mark buffer.

+
Parameters
+ + + +
thdMutator's thread data
objObject to gray
+
+
+

These are pended because they are written in a batch during minor GC. To prevent race conditions we wait until all of the writes are made before updating last write.

TODO: figure out a new name for this function.

diff --git a/c-api/group__gc__major_ga976021ebdbed6eb538d78c744c1ef931.html b/c-api/group__gc__major_ga976021ebdbed6eb538d78c744c1ef931.html index 1560e217..55d32cda 100644 --- a/c-api/group__gc__major_ga976021ebdbed6eb538d78c744c1ef931.html +++ b/c-api/group__gc__major_ga976021ebdbed6eb538d78c744c1ef931.html @@ -148,7 +148,7 @@ $(function() { void* gc_alloc ( gc_heap_root *  - h, + hrt, @@ -182,6 +182,20 @@ $(function() {
+

Allocate memory on the heap for an object.

+
Parameters
+ + + + + + +
hrtThe root of the heap to allocate from
sizeSize of the object to allocate
objObject containing data to copy to the heap
thdThe requesting mutator's thread data object
heap_grownPointer to an "out" parameter that will be set to 1 if the heap is grown in size.
+
+
+
Returns
Pointer to the heap object
+

This function will attempt to grow the heap if it is full, and will terminate the program if the OS is out of memory.

+
diff --git a/c-api/group__gc__major_ga9c86247beb6521f42271c87685c41288.html b/c-api/group__gc__major_ga9c86247beb6521f42271c87685c41288.html index e9660843..042843c0 100644 --- a/c-api/group__gc__major_ga9c86247beb6521f42271c87685c41288.html +++ b/c-api/group__gc__major_ga9c86247beb6521f42271c87685c41288.html @@ -176,6 +176,18 @@ $(function() {
+

Initialize runtime data structures for a thread.

+
Parameters
+ + + + + +
thdMutator's thread data
mut_numUnused
stack_baseBottom of the mutator's stack
stack_sizeMax allowed size of mutator's stack before triggering minor GC
+
+
+

Must be called on the target thread itself during startup, to verify stack limits are setup correctly.

+
diff --git a/c-api/group__gc__major_gaa1745070eb682d926f656f3017ccedda.html b/c-api/group__gc__major_gaa1745070eb682d926f656f3017ccedda.html index 96b52568..c96e3801 100644 --- a/c-api/group__gc__major_gaa1745070eb682d926f656f3017ccedda.html +++ b/c-api/group__gc__major_gaa1745070eb682d926f656f3017ccedda.html @@ -169,7 +169,17 @@ $(function() {
-

Write barrier for updates to heap-allocated objects The key for this barrier is to identify stack objects that contain heap references, so they can be marked to avoid collection.

+ +

Write barrier for updates to heap-allocated objects.

+
Parameters
+ + + + +
thdMutator's thread data
old_objOld object value prior to the mutation
valueNew object value
+
+
+

The key for this barrier is to identify stack objects that contain heap references, so they can be marked to avoid collection.

diff --git a/c-api/group__gc__major_gaa8776e5cc0c3bf309c76dc61f0c7f838.html b/c-api/group__gc__major_gaa8776e5cc0c3bf309c76dc61f0c7f838.html index 00e3335b..0f6c01d6 100644 --- a/c-api/group__gc__major_gaa8776e5cc0c3bf309c76dc61f0c7f838.html +++ b/c-api/group__gc__major_gaa8776e5cc0c3bf309c76dc61f0c7f838.html @@ -163,7 +163,16 @@ $(function() {
-

Mark the given object gray if it is on the heap. Note marking is done implicitly by placing it in a buffer, to avoid repeated re-scanning.

+ +

Mark the given object gray if it is on the heap.

+
Parameters
+ + + +
thdMutator's thread data
objObject to gray
+
+
+

Note marking is done implicitly by placing it in a buffer, to avoid repeated re-scanning.

This function must be executed once the thread lock has been acquired.

diff --git a/c-api/group__gc__major_gab19d274a8cfbf5274db73e35f2fb18b5.html b/c-api/group__gc__major_gab19d274a8cfbf5274db73e35f2fb18b5.html index 6fc898fc..9501a641 100644 --- a/c-api/group__gc__major_gab19d274a8cfbf5274db73e35f2fb18b5.html +++ b/c-api/group__gc__major_gab19d274a8cfbf5274db73e35f2fb18b5.html @@ -176,6 +176,19 @@ $(function() {
+

Sweep portion of the GC algorithm.

+
Parameters
+ + + + + +
hHeap to sweep
heap_typeType of heap, based on object sizes allocated on it
sum_freed_ptrOut parameter tracking the sum of freed data, in bytes. This parameter is ignored if NULL is passed.
thdThread data object for the mutator using this heap
+
+
+
Returns
Return the size of the largest object freed, in bytes
+

This portion of the major GC algorithm is responsible for returning unused memory slots to the heap. It is only called by the collector thread after the heap has been traced to identify live objects.

+
diff --git a/c-api/group__gc__major_gabbaa9e82df175595165b5309ffb360b5.html b/c-api/group__gc__major_gabbaa9e82df175595165b5309ffb360b5.html index 815193c6..8debc9c7 100644 --- a/c-api/group__gc__major_gabbaa9e82df175595165b5309ffb360b5.html +++ b/c-api/group__gc__major_gabbaa9e82df175595165b5309ffb360b5.html @@ -164,6 +164,15 @@ $(function() {
+

Mark globals as part of the tracing collector.

+
Parameters
+ + + +
globals
global_tableThis is called by the collector thread
+
+
+
diff --git a/c-api/group__gc__major_gabebf61106ee21a438dcb21fc8a9fb05b.html b/c-api/group__gc__major_gabebf61106ee21a438dcb21fc8a9fb05b.html index 9e394cf8..dd8f9b9c 100644 --- a/c-api/group__gc__major_gabebf61106ee21a438dcb21fc8a9fb05b.html +++ b/c-api/group__gc__major_gabebf61106ee21a438dcb21fc8a9fb05b.html @@ -163,7 +163,16 @@ $(function() {
-

Merge one heap into another. Assumes appropriate locks are already held.

+ +

Merge one heap into another.

+
Parameters
+ + + +
hdestHeap that will receive new pages
hsrcHeap that is being merged to the end of hdest
+
+
+

This function assumes appropriate locks are already held.

diff --git a/c-api/group__gc__major_gabf9a3adddd986f1f953d4ddc1c795491.html b/c-api/group__gc__major_gabf9a3adddd986f1f953d4ddc1c795491.html index 6d3451b1..d318c033 100644 --- a/c-api/group__gc__major_gabf9a3adddd986f1f953d4ddc1c795491.html +++ b/c-api/group__gc__major_gabf9a3adddd986f1f953d4ddc1c795491.html @@ -154,6 +154,14 @@ $(function() {
+

Free all data for the given mutator.

+
Parameters
+ + +
thdMutator's thread data object containing data to free
+
+
+
diff --git a/c-api/group__gc__major_gacc34220240fa78aaed5482565c8952e6.html b/c-api/group__gc__major_gacc34220240fa78aaed5482565c8952e6.html index 44537c0f..af47e0fa 100644 --- a/c-api/group__gc__major_gacc34220240fa78aaed5482565c8952e6.html +++ b/c-api/group__gc__major_gacc34220240fa78aaed5482565c8952e6.html @@ -182,6 +182,21 @@ $(function() {
+

Grow a heap by allocating a new page.

+
Parameters
+ + + + + + +
hHeap to be expanded
heap_typeDefine the size of objects that will be allocated on this heap
sizeNot applicable, can set to 0
chunk_sizeHeap chunk size, or 0 if not applicable
thdThread data for the mutator using this heap
+
+
+
Returns
A true value if the heap was grown, or 0 otherwise
+

Heaps are increased in size by adding a newly-allocated page at the end of the heap's linked list.

+

Page size is determined by starting at the minimum page size and increasing size using the Fibonnaci Sequence until reaching the max size.

+
diff --git a/c-api/group__gc__major_gacdd780abddd9b089bc19771035890bf5.html b/c-api/group__gc__major_gacdd780abddd9b089bc19771035890bf5.html index 5a546cf0..522dcc82 100644 --- a/c-api/group__gc__major_gacdd780abddd9b089bc19771035890bf5.html +++ b/c-api/group__gc__major_gacdd780abddd9b089bc19771035890bf5.html @@ -153,6 +153,8 @@ $(function() {
+

Spawn the collector thread.

+
diff --git a/c-api/group__gc__major_gadd73c9a0b9b1112d6d941dee642893e7.html b/c-api/group__gc__major_gadd73c9a0b9b1112d6d941dee642893e7.html index d0e0f56d..c74d6810 100644 --- a/c-api/group__gc__major_gadd73c9a0b9b1112d6d941dee642893e7.html +++ b/c-api/group__gc__major_gadd73c9a0b9b1112d6d941dee642893e7.html @@ -153,6 +153,9 @@ $(function() {
+

The collector's tracing algorithm.

+

This function ensures all live objects are marked prior to transitioning to the collector's sweep phase.

+
diff --git a/c-api/group__gc__major_gadf94b852782bd0108138e3b97fc1113b.html b/c-api/group__gc__major_gadf94b852782bd0108138e3b97fc1113b.html index be6bd4ad..27e3c3d1 100644 --- a/c-api/group__gc__major_gadf94b852782bd0108138e3b97fc1113b.html +++ b/c-api/group__gc__major_gadf94b852782bd0108138e3b97fc1113b.html @@ -163,8 +163,15 @@ $(function() {
-

Called explicitly from a mutator thread to let the collector know it (may) block for an unknown period of time.

-

The current continuation is required so that we can trace over it in case the collector has to cooperate for the mutator.

+ +

Called explicitly from a mutator thread to let the collector know it (may) block for an unknown period of time.

+
Parameters
+ + + +
thdMutator's thread data
contThe mutator's current continuation. This is required so that we can trace over this object in case the collector has to cooperate for the mutator.
+
+
diff --git a/c-api/group__gc__major_gae43e9fb0564edc5ecf489ead57731d52.html b/c-api/group__gc__major_gae43e9fb0564edc5ecf489ead57731d52.html index eb849cb1..bcf95a45 100644 --- a/c-api/group__gc__major_gae43e9fb0564edc5ecf489ead57731d52.html +++ b/c-api/group__gc__major_gae43e9fb0564edc5ecf489ead57731d52.html @@ -163,7 +163,16 @@ $(function() {
-

Called explicitly from a mutator thread to let the collector know that it has finished blocking. In addition, if the collector cooperated on behalf of the mutator while it was blocking, the mutator will move any remaining stack objects to the heap and longjmp.

+ +

Called explicitly from a mutator thread to let the collector know that it has finished blocking.

+
Parameters
+ + + +
thdMutator's thread data
resultData returned by the blocking function
+
+
+

In addition, if the collector cooperated on behalf of the mutator while it was blocking, the mutator will move any remaining stack objects to the heap and longjmp.

diff --git a/c-api/group__gc__major_gaec0fd25a5b345b9ad50842b08bed4027.html b/c-api/group__gc__major_gaec0fd25a5b345b9ad50842b08bed4027.html index 67d5cc42..db7a5893 100644 --- a/c-api/group__gc__major_gaec0fd25a5b345b9ad50842b08bed4027.html +++ b/c-api/group__gc__major_gaec0fd25a5b345b9ad50842b08bed4027.html @@ -154,6 +154,15 @@ $(function() {
+

A convenience function for allocating bignums.

+
Parameters
+ + +
dataThe mutator's thread data object
+
+
+
Returns
Pointer to a heap object for the bignum
+
diff --git a/c-api/types_8h.html b/c-api/types_8h.html index 062c30d9..f8fe8df0 100644 --- a/c-api/types_8h.html +++ b/c-api/types_8h.html @@ -553,22 +553,31 @@ Functions  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) + Allocate memory on the heap for an object. More...
  void * gc_alloc_bignum (gc_thread_data *data) + A convenience function for allocating bignums. More...
  void * gc_alloc_from_bignum (gc_thread_data *data, bignum_type *src) + A helper function to create a heap-allocated copy of a bignum. More...
  size_t gc_allocated_bytes (object obj, gc_free_list *q, gc_free_list *r) + Get the number of bytes that will be allocated for obj. More...
  void gc_collector_trace () + The collector's tracing algorithm. More...
  char * gc_copy_obj (object hp, char *obj, gc_thread_data *thd) + Copy given object into given heap object. More...
  void gc_empty_collector_stack () + Empty the collector's mark stack. More...
  int gc_grow_heap (gc_heap *h, int heap_type, size_t size, size_t chunk_size, gc_thread_data *thd) + Grow a heap by allocating a new page. More...
  void gc_handshake (gc_status_type s) + Called by the collector thread to perform a handshake with all of the mutators. More...
  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...
@@ -577,8 +586,10 @@ Functions  Free a page of the heap. More...
  gc_heapgc_heap_last (gc_heap *h) + Get the heap's last page. More...
  void gc_heap_merge (gc_heap *hdest, gc_heap *hsrc) + Merge one heap into another. More...
  size_t gc_heap_total_size (gc_heap *h)   @@ -586,28 +597,39 @@ Functions  Perform one-time initialization before mutators can be executed. More...
  int gc_is_stack_obj (gc_thread_data *thd, object obj) + Determine if object lives on the thread's stack. More...
  void gc_mark_globals (object globals, object global_table) + Mark globals as part of the tracing collector. More...
  void gc_mark_gray (gc_thread_data *thd, object obj) + Mark the given object gray if it is on the heap. More...
  void gc_mark_gray2 (gc_thread_data *thd, object obj) + Add a pending write to the mark buffer. More...
  void gc_merge_all_heaps (gc_thread_data *dest, gc_thread_data *src) + Merge all thread heaps into another. More...
  int gc_minor (void *data, object low_limit, object high_limit, closure cont, object *args, int num_args)   void gc_mut_cooperate (gc_thread_data *thd, int buf_len) + Called by a mutator to cooperate with the collector thread. More...
  void gc_mut_update (gc_thread_data *thd, object old_obj, object value) + Write barrier for updates to heap-allocated objects. More...
  void gc_mutator_thread_blocked (gc_thread_data *thd, object cont) + Called explicitly from a mutator thread to let the collector know it (may) block for an unknown period of time. More...
  void gc_mutator_thread_runnable (gc_thread_data *thd, object result) + Called explicitly from a mutator thread to let the collector know that it has finished blocking. More...
  void gc_post_handshake (gc_status_type s) + Change GC status to the given type. More...
  void gc_print_stats (gc_heap *h) + Print heap usage information. Before calling this function the current thread must have the heap lock. More...
  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...
@@ -615,20 +637,28 @@ Functions void gc_request_mark_globals (void)   void gc_start_collector () + Spawn the collector thread. More...
  size_t gc_sweep (gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd) + Sweep portion of the GC algorithm. More...
  void gc_thr_add_to_move_buffer (gc_thread_data *d, int *alloci, object obj) + Add an object to the move buffer. More...
  void gc_thr_grow_move_buffer (gc_thread_data *d) + Increase the size of the mutator's move buffer. More...
  void gc_thread_data_free (gc_thread_data *thd) + Free all data for the given mutator. More...
  void gc_thread_data_init (gc_thread_data *thd, int mut_num, char *stack_base, long stack_size) + Initialize runtime data structures for a thread. More...
  void * gc_try_alloc (gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd) + Attempt to allocate a new heap slot for the given object. More...
  void gc_wait_handshake () + Wait for all mutators to handshake. More...
  double mp_get_double (mp_int *a)   diff --git a/c-api/types_8h_a9f542dda06a1a342304c570baf6347a0.html b/c-api/types_8h_a9f542dda06a1a342304c570baf6347a0.html index 321f99db..edd1653b 100644 --- a/c-api/types_8h_a9f542dda06a1a342304c570baf6347a0.html +++ b/c-api/types_8h_a9f542dda06a1a342304c570baf6347a0.html @@ -300,6 +300,16 @@ $(function() {
+

A helper function to create a heap-allocated copy of a bignum.

+
Parameters
+ + + +
dataThe mutator's thread data object
srcThe bignum instance to copy to the heap
+
+
+
Returns
Pointer to the heap object
+
diff --git a/c-api/types_8h_source.html b/c-api/types_8h_source.html index 71054e4d..c1320fc7 100644 --- a/c-api/types_8h_source.html +++ b/c-api/types_8h_source.html @@ -86,18 +86,18 @@ $(function() {
STAGE_SWEEPING
Definition: types.h:231
symbol_type::desc
const char * desc
Definition: types.h:612
CYC_THREAD_STATE_RUNNABLE
Definition: types.h:245
-
gc_handshake
void gc_handshake(gc_status_type s)
Definition: gc.c:1474
+
gc_handshake
void gc_handshake(gc_status_type s)
Called by the collector thread to perform a handshake with all of the mutators.
Definition: gc.c:1615
port_type::tag
tag_type tag
Definition: types.h:759
object
void * object
Definition: types.h:27
gc_heap_root_t::heap
gc_heap ** heap
Definition: types.h:206
common_type::pair_t
pair_type pair_t
Definition: types.h:1029
-
gc_is_stack_obj
int gc_is_stack_obj(gc_thread_data *thd, object obj)
Definition: gc.c:1098
+
gc_is_stack_obj
int gc_is_stack_obj(gc_thread_data *thd, object obj)
Determine if object lives on the thread&#39;s stack.
Definition: gc.c:1203
gc_thread_data_t::stack_limit
char * stack_limit
Definition: types.h:262
closure1_type
A closed-over function with one variable.
Definition: types.h:955
-
gc_heap_merge
void gc_heap_merge(gc_heap *hdest, gc_heap *hsrc)
Definition: gc.c:1802
+
gc_heap_merge
void gc_heap_merge(gc_heap *hdest, gc_heap *hsrc)
Merge one heap into another.
Definition: gc.c:1980
gc_thread_data_t::mark_buffer_len
int mark_buffer_len
Definition: types.h:284
c_opaque
c_opaque_type * c_opaque
Definition: types.h:550
-
gc_mutator_thread_runnable
void gc_mutator_thread_runnable(gc_thread_data *thd, object result)
Definition: gc.c:1861
+
gc_mutator_thread_runnable
void gc_mutator_thread_runnable(gc_thread_data *thd, object result)
Called explicitly from a mutator thread to let the collector know that it has finished blocking...
Definition: gc.c:2045
gc_heap_t::next_free
gc_heap * next_free
Definition: types.h:193
gc_thread_data_t::cached_heap_free_sizes
uintptr_t * cached_heap_free_sizes
Definition: types.h:289
vector
vector_type * vector
Definition: types.h:786
@@ -107,34 +107,34 @@ $(function() {
gc_thread_data_t::cached_heap_total_sizes
uintptr_t * cached_heap_total_sizes
Definition: types.h:290
pair_type
The pair (cons) type.
Definition: types.h:830
integer_type::value
int value
Definition: types.h:632
-
gc_thr_add_to_move_buffer
void gc_thr_add_to_move_buffer(gc_thread_data *d, int *alloci, object obj)
Definition: gc.c:1040
+
gc_thr_add_to_move_buffer
void gc_thr_add_to_move_buffer(gc_thread_data *d, int *alloci, object obj)
Add an object to the move buffer.
Definition: gc.c:1139
CYC_THREAD_STATE_BLOCKED_COOPERATING
Definition: types.h:246
gc_thread_data_t::gc_status
int gc_status
Definition: types.h:279
gc_thread_data_t
Definition: types.h:256
closure0_type::fn
function_type fn
Definition: types.h:951
double_type::tag
tag_type tag
Definition: types.h:659
-
gc_post_handshake
void gc_post_handshake(gc_status_type s)
Definition: gc.c:1480
+
gc_post_handshake
void gc_post_handshake(gc_status_type s)
Change GC status to the given type.
Definition: gc.c:1625
pair_type::pair_car
object pair_car
Definition: types.h:833
closureN_tag
Definition: types.h:41
primitive
primitive_type * primitive
Definition: types.h:1012
closure0_type::num_args
int num_args
Definition: types.h:952
-
gc_mut_cooperate
void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
Definition: gc.c:1155
+
gc_mut_cooperate
void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
Called by a mutator to cooperate with the collector thread.
Definition: gc.c:1272
port_tag
Definition: types.h:52
cvar_type::pvar
object * pvar
Definition: types.h:524
pair_type::tag
tag_type tag
Definition: types.h:832
gc_thread_data_t::stack_start
char * stack_start
Definition: types.h:261
-
gc_start_collector
void gc_start_collector()
Definition: gc.c:1649
+
gc_start_collector
void gc_start_collector()
Spawn the collector thread.
Definition: gc.c:1807
gc_thread_data_t::jmp_start
jmp_buf * jmp_start
Definition: types.h:272
CYC_BN_GTE
Definition: types.h:696
string_tag
Definition: types.h:54
function_type_va
void(* function_type_va)(int, object, object, object,...)
Definition: types.h:515
-
gc_collector_trace
void gc_collector_trace()
Definition: gc.c:1414
+
gc_collector_trace
void gc_collector_trace()
The collector&#39;s tracing algorithm.
Definition: gc.c:1545
gc_heap_t::free_list
gc_free_list * free_list
Definition: types.h:196
integer_tag
Definition: types.h:47
mutex_type::hdr
gc_header_type hdr
Definition: types.h:569
c_opaque_type::tag
tag_type tag
Definition: types.h:546
common_type::boolean_t
boolean_type boolean_t
Definition: types.h:1028
-
gc_thread_data_free
void gc_thread_data_free(gc_thread_data *thd)
Definition: gc.c:1755
+
gc_thread_data_free
void gc_thread_data_free(gc_thread_data *thd)
Free all data for the given mutator.
Definition: gc.c:1929
gc_thread_data_t::mark_buffer
void ** mark_buffer
Definition: types.h:283
gc_header_type_t::grayed
unsigned char grayed
Definition: types.h:215
closureN_type::hdr
gc_header_type hdr
Definition: types.h:964
@@ -155,13 +155,13 @@ $(function() {
gc_thread_data_t::last_write
int last_write
Definition: types.h:280
closure1_type::tag
tag_type tag
Definition: types.h:957
gc_heap_free
gc_heap * gc_heap_free(gc_heap *page, gc_heap *prev_page)
Free a page of the heap.
Definition: gc.c:283
-
gc_grow_heap
int gc_grow_heap(gc_heap *h, int heap_type, size_t size, size_t chunk_size, gc_thread_data *thd)
Definition: gc.c:514
+
gc_grow_heap
int gc_grow_heap(gc_heap *h, int heap_type, size_t size, size_t chunk_size, gc_thread_data *thd)
Grow a heap by allocating a new page.
Definition: gc.c:538
closureN_type::num_elements
int num_elements
Definition: types.h:968
primitive_type::hdr
gc_header_type hdr
Definition: types.h:1007
common_type::double_t
double_type double_t
Definition: types.h:1033
closure
closure0_type * closure
Definition: types.h:975
double_type::hdr
gc_header_type hdr
Definition: types.h:658
-
gc_mark_gray2
void gc_mark_gray2(gc_thread_data *thd, object obj)
Definition: gc.c:1273
+
gc_mark_gray2
void gc_mark_gray2(gc_thread_data *thd, object obj)
Add a pending write to the mark buffer.
Definition: gc.c:1396
pair_type::pair_cdr
object pair_cdr
Definition: types.h:834
double_type
Double-precision floating point type, also known as a flonum.
Definition: types.h:657
primitive_type
A function built into the runtime.
Definition: types.h:1006
@@ -173,22 +173,22 @@ $(function() {
boolean_type
The boolean type: True or False.
Definition: types.h:593
HEAP_SM
Definition: types.h:163
primitive_type::fn
function_type fn
Definition: types.h:1010
-
gc_alloc_bignum
void * gc_alloc_bignum(gc_thread_data *data)
Definition: gc.c:615
+
gc_alloc_bignum
void * gc_alloc_bignum(gc_thread_data *data)
A convenience function for allocating bignums.
Definition: gc.c:655
closure1_tag
Definition: types.h:40
string_type::str
char * str
Definition: types.h:706
double_tag
Definition: types.h:44
macro_type::fn
function_type fn
Definition: types.h:943
-
gc_thr_grow_move_buffer
void gc_thr_grow_move_buffer(gc_thread_data *d)
Definition: gc.c:1022
-
gc_try_alloc
void * gc_try_alloc(gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd)
Definition: gc.c:568
+
gc_thr_grow_move_buffer
void gc_thr_grow_move_buffer(gc_thread_data *d)
Increase the size of the mutator&#39;s move buffer.
Definition: gc.c:1115
+
gc_try_alloc
void * gc_try_alloc(gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd)
Attempt to allocate a new heap slot for the given object.
Definition: gc.c:604
cvar_type
C-variable integration type - wrapper around a Cyclone object pointer.
Definition: types.h:520
closure1_type::element
object element
Definition: types.h:960
symbol_type::hdr
gc_header_type hdr
Definition: types.h:610
macro_type::num_args
int num_args
Definition: types.h:944
mutex
mutex_type * mutex
Definition: types.h:573
bytevector_type::len
int len
Definition: types.h:806
-
gc_mark_globals
void gc_mark_globals(object globals, object global_table)
Definition: gc.c:1660
+
gc_mark_globals
void gc_mark_globals(object globals, object global_table)
Mark globals as part of the tracing collector.
Definition: gc.c:1823
closure0_tag
Definition: types.h:39
-
gc_print_stats
void gc_print_stats(gc_heap *h)
Definition: gc.c:320
+
gc_print_stats
void gc_print_stats(gc_heap *h)
Print heap usage information. Before calling this function the current thread must have the heap lock...
Definition: gc.c:321
macro_tag
Definition: types.h:49
boolean_type::hdr
gc_header_type hdr
Definition: types.h:594
closureN_type::num_args
int num_args
Definition: types.h:967
@@ -201,7 +201,7 @@ $(function() {
gc_heap_t::size
unsigned int size
Definition: types.h:188
symbol_tag
Definition: types.h:55
gc_free_list_t::size
unsigned int size
Definition: types.h:178
-
gc_mark_gray
void gc_mark_gray(gc_thread_data *thd, object obj)
Definition: gc.c:1247
+
gc_mark_gray
void gc_mark_gray(gc_thread_data *thd, object obj)
Mark the given object gray if it is on the heap.
Definition: gc.c:1367
tag_type
unsigned char tag_type
Definition: types.h:66
closureN_type
A closed-over function with zero or more closed-over variables.
Definition: types.h:963
gc_request_mark_globals
void gc_request_mark_globals(void)
Definition: runtime.c:4594
@@ -209,12 +209,12 @@ $(function() {
gc_heap_t::next
gc_heap * next
Definition: types.h:197
vector_type::elements
object * elements
Definition: types.h:784
string_type
The string type.
Definition: types.h:702
-
gc_alloc_from_bignum
void * gc_alloc_from_bignum(gc_thread_data *data, bignum_type *src)
Definition: gc.c:633
+
gc_alloc_from_bignum
void * gc_alloc_from_bignum(gc_thread_data *data, bignum_type *src)
A helper function to create a heap-allocated copy of a bignum.
Definition: gc.c:679
boolean
boolean_type * boolean
Definition: types.h:598
gc_thread_data_t::lock
pthread_mutex_t lock
Definition: types.h:285
function_type
void(* function_type)()
Definition: types.h:512
STATUS_ASYNC
Definition: types.h:225
-
gc_copy_obj
char * gc_copy_obj(object hp, char *obj, gc_thread_data *thd)
Definition: gc.c:349
+
gc_copy_obj
char * gc_copy_obj(object hp, char *obj, gc_thread_data *thd)
Copy given object into given heap object.
Definition: gc.c:359
gc_thread_data_t::moveBufLen
int moveBufLen
Definition: types.h:269
gc_header_type_t::mark
unsigned char mark
Definition: types.h:214
boolean_type::desc
const char * desc
Definition: types.h:596
@@ -224,8 +224,8 @@ $(function() {
cond_var_tag
Definition: types.h:42
gc_thread_data_t::heap_lock
pthread_mutex_t heap_lock
Definition: types.h:286
common_type::symbol_t
symbol_type symbol_t
Definition: types.h:1030
-
gc_mutator_thread_blocked
void gc_mutator_thread_blocked(gc_thread_data *thd, object cont)
Definition: gc.c:1840
-
gc_merge_all_heaps
void gc_merge_all_heaps(gc_thread_data *dest, gc_thread_data *src)
Definition: gc.c:1812
+
gc_mutator_thread_blocked
void gc_mutator_thread_blocked(gc_thread_data *thd, object cont)
Called explicitly from a mutator thread to let the collector know it (may) block for an unknown perio...
Definition: gc.c:2020
+
gc_merge_all_heaps
void gc_merge_all_heaps(gc_thread_data *dest, gc_thread_data *src)
Merge all thread heaps into another.
Definition: gc.c:1993
closure0_type::tag
tag_type tag
Definition: types.h:950
port_type::mem_buf
char * mem_buf
Definition: types.h:762
cvar_type::hdr
gc_header_type hdr
Definition: types.h:521
@@ -249,7 +249,7 @@ $(function() {
gc_thread_data_t::stack_prev_frame
char * stack_prev_frame
Definition: types.h:294
integer_type::tag
tag_type tag
Definition: types.h:631
STATUS_SYNC2
Definition: types.h:225
-
gc_mut_update
void gc_mut_update(gc_thread_data *thd, object old_obj, object value)
Definition: gc.c:1127
+
gc_mut_update
void gc_mut_update(gc_thread_data *thd, object old_obj, object value)
Write barrier for updates to heap-allocated objects.
Definition: gc.c:1236
closure1_type::fn
function_type fn
Definition: types.h:958
bytevector_tag
Definition: types.h:37
gc_thread_data_t::gc_cont
object gc_cont
Definition: types.h:274
@@ -258,7 +258,7 @@ $(function() {
STAGE_RESTING
Definition: types.h:231
gc_thread_data_t::mutation_buflen
int mutation_buflen
Definition: types.h:265
integer_type::hdr
gc_header_type hdr
Definition: types.h:630
-
gc_thread_data_init
void gc_thread_data_init(gc_thread_data *thd, int mut_num, char *stack_base, long stack_size)
Definition: gc.c:1692
+
gc_thread_data_init
void gc_thread_data_init(gc_thread_data *thd, int mut_num, char *stack_base, long stack_size)
Initialize runtime data structures for a thread.
Definition: gc.c:1862
CYC_BN_LT
Definition: types.h:693
bytevector_type::tag
tag_type tag
Definition: types.h:805
symbol_type::tag
const tag_type tag
Definition: types.h:611
@@ -271,12 +271,12 @@ $(function() {
gc_heap_t::type
gc_heap_type type
Definition: types.h:187
vector_type::hdr
gc_header_type hdr
Definition: types.h:781
CYC_THREAD_STATE_TERMINATED
Definition: types.h:247
-
gc_empty_collector_stack
void gc_empty_collector_stack()
Definition: gc.c:1459
+
gc_empty_collector_stack
void gc_empty_collector_stack()
Empty the collector&#39;s mark stack.
Definition: gc.c:1595
HEAP_64
Definition: types.h:164
mutex_type::tag
tag_type tag
Definition: types.h:570
CYC_BN_LTE
Definition: types.h:692
gc_thread_data_t::exception_handler_stack
object exception_handler_stack
Definition: types.h:296
-
gc_wait_handshake
void gc_wait_handshake()
Definition: gc.c:1487
+
gc_wait_handshake
void gc_wait_handshake()
Wait for all mutators to handshake.
Definition: gc.c:1640
gc_free_list_t
Definition: types.h:177
gc_thread_data_t::moveBuf
void ** moveBuf
Definition: types.h:268
Cyc_bignum_cmp
int Cyc_bignum_cmp(bn_cmp_type type, object x, int tx, object y, int ty)
Definition: runtime.c:1269
@@ -293,13 +293,13 @@ $(function() {
gc_header_type_t
Definition: types.h:213
gc_thread_data_t::thread_state
cyc_thread_state_type thread_state
Definition: types.h:259
HEAP_HUGE
Definition: types.h:167
-
gc_alloc
void * gc_alloc(gc_heap_root *h, size_t size, char *obj, gc_thread_data *thd, int *heap_grown)
Definition: gc.c:639
+
gc_alloc
void * gc_alloc(gc_heap_root *h, size_t size, char *obj, gc_thread_data *thd, int *heap_grown)
Allocate memory on the heap for an object.
Definition: gc.c:698
integer_type
Deprecated - boxed integers.
Definition: types.h:629
gc_status_type
gc_status_type
Definition: types.h:225
gc_free_list_t::next
gc_free_list * next
Definition: types.h:179
closure0_type::hdr
gc_header_type hdr
Definition: types.h:949
closure0
closure0_type * closure0
Definition: types.h:972
-
gc_allocated_bytes
size_t gc_allocated_bytes(object obj, gc_free_list *q, gc_free_list *r)
Definition: gc.c:698
+
gc_allocated_bytes
size_t gc_allocated_bytes(object obj, gc_free_list *q, gc_free_list *r)
Get the number of bytes that will be allocated for obj.
Definition: gc.c:764
boolean_type::tag
const tag_type tag
Definition: types.h:595
eof_tag
Definition: types.h:45
forward_tag
Definition: types.h:46
@@ -313,10 +313,10 @@ $(function() {
closure1
closure1_type * closure1
Definition: types.h:973
port_type::hdr
gc_header_type hdr
Definition: types.h:758
global_table
list global_table
Definition: runtime.c:386
-
gc_heap_last
gc_heap * gc_heap_last(gc_heap *h)
Definition: gc.c:757
+
gc_heap_last
gc_heap * gc_heap_last(gc_heap *h)
Get the heap&#39;s last page.
Definition: gc.c:831
vpbuffer_add
void ** vpbuffer_add(void **buf, int *len, int i, void *obj)
Definition: runtime.c:5438
bn_cmp_type
bn_cmp_type
Definition: types.h:691
-
gc_sweep
size_t gc_sweep(gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd)
Definition: gc.c:852
+
gc_sweep
size_t gc_sweep(gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd)
Sweep portion of the GC algorithm.
Definition: gc.c:941
primitive_type::tag
tag_type tag
Definition: types.h:1008
macro_type::tag
tag_type tag
Definition: types.h:942
integer_type::padding
int padding
Definition: types.h:633