From 2d02805420989ae817de1ba289e411ea5817719e Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 28 Feb 2017 00:10:03 -0500 Subject: [PATCH] Sync --- c-api/gc_8c.html | 35 +++++++++++ ..._8c_a098c8f133063f61acf0ea4f61e02f759.html | 10 ++++ ..._8c_a3fd0cf1889f90874133c0eb94866180c.html | 9 ++- ..._8c_a9f542dda06a1a342304c570baf6347a0.html | 10 ++++ ..._8c_ab08135ec4278369570fa94a56283bbb1.html | 2 + ..._8c_ad8f6f6f44acdb47b0ef6451f9822377e.html | 2 + ..._8c_ae989c655a69c574af497e996f27e6cae.html | 10 +++- c-api/group__gc__major.html | 29 +++++++++ ...or_ga15186c504a0fb0727cd7d405b0b2d9a5.html | 14 ++++- ...or_ga2031d7ff5d1678d2aa7954c5fa3b989e.html | 11 +++- ...or_ga20cf7c4fac92c3cb1adb025813ea2a99.html | 8 +++ ...or_ga2118e3b31300a7ddcd96c95e218f862e.html | 9 ++- ...or_ga2f62288e6f57fe9fbff4bae5bd782e44.html | 11 ++++ ...or_ga34834cdbd4e4f511ad8e918f0fb2d765.html | 10 ++++ ...or_ga46bc54c66f56b0006420ce310c2729c1.html | 8 +++ ...or_ga4c76104f4bb633c0594334508f8a19b1.html | 3 + ...or_ga51690b332091995ffd5c7318f569f934.html | 3 + ...or_ga63112677a59a58464bc08d5ef2a91c6c.html | 8 +++ ...or_ga6490c2be516744d1cdc225b9ef2688ca.html | 11 +++- ...or_ga6934bc689d9c64df40d96fbd4db8cbd7.html | 14 +++++ ...or_ga6a88578b8802b9bca9f56e0ccfdff435.html | 10 ++++ ...or_ga7f1dfa939185ca0cf6d194c991000185.html | 10 ++++ ...or_ga7fac46df80136375f0aabd3af30a8874.html | 11 +++- ...or_ga976021ebdbed6eb538d78c744c1ef931.html | 16 ++++- ...or_ga9c86247beb6521f42271c87685c41288.html | 12 ++++ ...or_gaa1745070eb682d926f656f3017ccedda.html | 12 +++- ...or_gaa8776e5cc0c3bf309c76dc61f0c7f838.html | 11 +++- ...or_gab19d274a8cfbf5274db73e35f2fb18b5.html | 13 ++++ ...or_gabbaa9e82df175595165b5309ffb360b5.html | 9 +++ ...or_gabebf61106ee21a438dcb21fc8a9fb05b.html | 11 +++- ...or_gabf9a3adddd986f1f953d4ddc1c795491.html | 8 +++ ...or_gacc34220240fa78aaed5482565c8952e6.html | 15 +++++ ...or_gacdd780abddd9b089bc19771035890bf5.html | 2 + ...or_gadd73c9a0b9b1112d6d941dee642893e7.html | 3 + ...or_gadf94b852782bd0108138e3b97fc1113b.html | 11 +++- ...or_gae43e9fb0564edc5ecf489ead57731d52.html | 11 +++- ...or_gaec0fd25a5b345b9ad50842b08bed4027.html | 9 +++ c-api/types_8h.html | 30 ++++++++++ ..._8h_a9f542dda06a1a342304c570baf6347a0.html | 10 ++++ c-api/types_8h_source.html | 60 +++++++++---------- 40 files changed, 447 insertions(+), 44 deletions(-) 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() {
Definition: types.h:231
const char * desc
Definition: types.h:612
Definition: types.h:245
-
void gc_handshake(gc_status_type s)
Definition: gc.c:1474
+
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
tag_type tag
Definition: types.h:759
void * object
Definition: types.h:27
gc_heap ** heap
Definition: types.h:206
pair_type pair_t
Definition: types.h:1029
-
int gc_is_stack_obj(gc_thread_data *thd, object obj)
Definition: gc.c:1098
+
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
char * stack_limit
Definition: types.h:262
A closed-over function with one variable.
Definition: types.h:955
-
void gc_heap_merge(gc_heap *hdest, gc_heap *hsrc)
Definition: gc.c:1802
+
void gc_heap_merge(gc_heap *hdest, gc_heap *hsrc)
Merge one heap into another.
Definition: gc.c:1980
int mark_buffer_len
Definition: types.h:284
c_opaque_type * c_opaque
Definition: types.h:550
-
void gc_mutator_thread_runnable(gc_thread_data *thd, object result)
Definition: gc.c:1861
+
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 * next_free
Definition: types.h:193
uintptr_t * cached_heap_free_sizes
Definition: types.h:289
vector_type * vector
Definition: types.h:786
@@ -107,34 +107,34 @@ $(function() {
uintptr_t * cached_heap_total_sizes
Definition: types.h:290
The pair (cons) type.
Definition: types.h:830
int value
Definition: types.h:632
-
void gc_thr_add_to_move_buffer(gc_thread_data *d, int *alloci, object obj)
Definition: gc.c:1040
+
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
Definition: types.h:246
int gc_status
Definition: types.h:279
Definition: types.h:256
function_type fn
Definition: types.h:951
tag_type tag
Definition: types.h:659
-
void gc_post_handshake(gc_status_type s)
Definition: gc.c:1480
+
void gc_post_handshake(gc_status_type s)
Change GC status to the given type.
Definition: gc.c:1625
object pair_car
Definition: types.h:833
Definition: types.h:41
primitive_type * primitive
Definition: types.h:1012
int num_args
Definition: types.h:952
-
void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
Definition: gc.c:1155
+
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
Definition: types.h:52
object * pvar
Definition: types.h:524
tag_type tag
Definition: types.h:832
char * stack_start
Definition: types.h:261
-
void gc_start_collector()
Definition: gc.c:1649
+
void gc_start_collector()
Spawn the collector thread.
Definition: gc.c:1807
jmp_buf * jmp_start
Definition: types.h:272
Definition: types.h:696
Definition: types.h:54
void(* function_type_va)(int, object, object, object,...)
Definition: types.h:515
-
void gc_collector_trace()
Definition: gc.c:1414
+
void gc_collector_trace()
The collector&#39;s tracing algorithm.
Definition: gc.c:1545
gc_free_list * free_list
Definition: types.h:196
Definition: types.h:47
gc_header_type hdr
Definition: types.h:569
tag_type tag
Definition: types.h:546
boolean_type boolean_t
Definition: types.h:1028
-
void gc_thread_data_free(gc_thread_data *thd)
Definition: gc.c:1755
+
void gc_thread_data_free(gc_thread_data *thd)
Free all data for the given mutator.
Definition: gc.c:1929
void ** mark_buffer
Definition: types.h:283
unsigned char grayed
Definition: types.h:215
gc_header_type hdr
Definition: types.h:964
@@ -155,13 +155,13 @@ $(function() {
int last_write
Definition: types.h:280
tag_type tag
Definition: types.h:957
gc_heap * gc_heap_free(gc_heap *page, gc_heap *prev_page)
Free a page of the heap.
Definition: gc.c:283
-
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
+
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
int num_elements
Definition: types.h:968
gc_header_type hdr
Definition: types.h:1007
double_type double_t
Definition: types.h:1033
closure0_type * closure
Definition: types.h:975
gc_header_type hdr
Definition: types.h:658
-
void gc_mark_gray2(gc_thread_data *thd, object obj)
Definition: gc.c:1273
+
void gc_mark_gray2(gc_thread_data *thd, object obj)
Add a pending write to the mark buffer.
Definition: gc.c:1396
object pair_cdr
Definition: types.h:834
Double-precision floating point type, also known as a flonum.
Definition: types.h:657
A function built into the runtime.
Definition: types.h:1006
@@ -173,22 +173,22 @@ $(function() {
The boolean type: True or False.
Definition: types.h:593
Definition: types.h:163
function_type fn
Definition: types.h:1010
-
void * gc_alloc_bignum(gc_thread_data *data)
Definition: gc.c:615
+
void * gc_alloc_bignum(gc_thread_data *data)
A convenience function for allocating bignums.
Definition: gc.c:655
Definition: types.h:40
char * str
Definition: types.h:706
Definition: types.h:44
function_type fn
Definition: types.h:943
-
void gc_thr_grow_move_buffer(gc_thread_data *d)
Definition: gc.c:1022
-
void * gc_try_alloc(gc_heap *h, int heap_type, size_t size, char *obj, gc_thread_data *thd)
Definition: gc.c:568
+
void gc_thr_grow_move_buffer(gc_thread_data *d)
Increase the size of the mutator&#39;s move buffer.
Definition: gc.c:1115
+
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
C-variable integration type - wrapper around a Cyclone object pointer.
Definition: types.h:520
object element
Definition: types.h:960
gc_header_type hdr
Definition: types.h:610
int num_args
Definition: types.h:944
mutex_type * mutex
Definition: types.h:573
int len
Definition: types.h:806
-
void gc_mark_globals(object globals, object global_table)
Definition: gc.c:1660
+
void gc_mark_globals(object globals, object global_table)
Mark globals as part of the tracing collector.
Definition: gc.c:1823
Definition: types.h:39
-
void gc_print_stats(gc_heap *h)
Definition: gc.c:320
+
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
Definition: types.h:49
gc_header_type hdr
Definition: types.h:594
int num_args
Definition: types.h:967
@@ -201,7 +201,7 @@ $(function() {
unsigned int size
Definition: types.h:188
Definition: types.h:55
unsigned int size
Definition: types.h:178
-
void gc_mark_gray(gc_thread_data *thd, object obj)
Definition: gc.c:1247
+
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
unsigned char tag_type
Definition: types.h:66
A closed-over function with zero or more closed-over variables.
Definition: types.h:963
void gc_request_mark_globals(void)
Definition: runtime.c:4594
@@ -209,12 +209,12 @@ $(function() {
gc_heap * next
Definition: types.h:197
object * elements
Definition: types.h:784
The string type.
Definition: types.h:702
-
void * gc_alloc_from_bignum(gc_thread_data *data, bignum_type *src)
Definition: gc.c:633
+
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_type * boolean
Definition: types.h:598
pthread_mutex_t lock
Definition: types.h:285
void(* function_type)()
Definition: types.h:512
Definition: types.h:225
-
char * gc_copy_obj(object hp, char *obj, gc_thread_data *thd)
Definition: gc.c:349
+
char * gc_copy_obj(object hp, char *obj, gc_thread_data *thd)
Copy given object into given heap object.
Definition: gc.c:359
int moveBufLen
Definition: types.h:269
unsigned char mark
Definition: types.h:214
const char * desc
Definition: types.h:596
@@ -224,8 +224,8 @@ $(function() {
Definition: types.h:42
pthread_mutex_t heap_lock
Definition: types.h:286
symbol_type symbol_t
Definition: types.h:1030
-
void gc_mutator_thread_blocked(gc_thread_data *thd, object cont)
Definition: gc.c:1840
-
void gc_merge_all_heaps(gc_thread_data *dest, gc_thread_data *src)
Definition: gc.c:1812
+
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
+
void gc_merge_all_heaps(gc_thread_data *dest, gc_thread_data *src)
Merge all thread heaps into another.
Definition: gc.c:1993
tag_type tag
Definition: types.h:950
char * mem_buf
Definition: types.h:762
gc_header_type hdr
Definition: types.h:521
@@ -249,7 +249,7 @@ $(function() {
char * stack_prev_frame
Definition: types.h:294
tag_type tag
Definition: types.h:631
Definition: types.h:225
-
void gc_mut_update(gc_thread_data *thd, object old_obj, object value)
Definition: gc.c:1127
+
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
function_type fn
Definition: types.h:958
Definition: types.h:37
object gc_cont
Definition: types.h:274
@@ -258,7 +258,7 @@ $(function() {
Definition: types.h:231
int mutation_buflen
Definition: types.h:265
gc_header_type hdr
Definition: types.h:630
-
void gc_thread_data_init(gc_thread_data *thd, int mut_num, char *stack_base, long stack_size)
Definition: gc.c:1692
+
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
Definition: types.h:693
tag_type tag
Definition: types.h:805
const tag_type tag
Definition: types.h:611
@@ -271,12 +271,12 @@ $(function() {
gc_heap_type type
Definition: types.h:187
gc_header_type hdr
Definition: types.h:781
Definition: types.h:247
-
void gc_empty_collector_stack()
Definition: gc.c:1459
+
void gc_empty_collector_stack()
Empty the collector&#39;s mark stack.
Definition: gc.c:1595
Definition: types.h:164
tag_type tag
Definition: types.h:570
Definition: types.h:692
object exception_handler_stack
Definition: types.h:296
-
void gc_wait_handshake()
Definition: gc.c:1487
+
void gc_wait_handshake()
Wait for all mutators to handshake.
Definition: gc.c:1640
Definition: types.h:177
void ** moveBuf
Definition: types.h:268
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() {
Definition: types.h:213
cyc_thread_state_type thread_state
Definition: types.h:259
Definition: types.h:167
-
void * gc_alloc(gc_heap_root *h, size_t size, char *obj, gc_thread_data *thd, int *heap_grown)
Definition: gc.c:639
+
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
Deprecated - boxed integers.
Definition: types.h:629
gc_status_type
Definition: types.h:225
gc_free_list * next
Definition: types.h:179
gc_header_type hdr
Definition: types.h:949
closure0_type * closure0
Definition: types.h:972
-
size_t gc_allocated_bytes(object obj, gc_free_list *q, gc_free_list *r)
Definition: gc.c:698
+
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
const tag_type tag
Definition: types.h:595
Definition: types.h:45
Definition: types.h:46
@@ -313,10 +313,10 @@ $(function() {
closure1_type * closure1
Definition: types.h:973
gc_header_type hdr
Definition: types.h:758
list global_table
Definition: runtime.c:386
-
gc_heap * gc_heap_last(gc_heap *h)
Definition: gc.c:757
+
gc_heap * gc_heap_last(gc_heap *h)
Get the heap&#39;s last page.
Definition: gc.c:831
void ** vpbuffer_add(void **buf, int *len, int i, void *obj)
Definition: runtime.c:5438
bn_cmp_type
Definition: types.h:691
-
size_t gc_sweep(gc_heap *h, int heap_type, size_t *sum_freed_ptr, gc_thread_data *thd)
Definition: gc.c:852
+
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
tag_type tag
Definition: types.h:1008
tag_type tag
Definition: types.h:942
int padding
Definition: types.h:633