mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
Split into separate paragraph
This commit is contained in:
parent
ee8104d9ed
commit
a5c94ae45c
1 changed files with 3 additions and 1 deletions
|
@ -149,7 +149,9 @@ Cyclone must guarantee the objects located on each mutator thread's stack are on
|
|||
|
||||
This requirement is critical as any existing references to a stack object will become invalid when that object is moved to the heap by minor GC. Without the proper safety measures in place this would lead to the potential for memory safety issues - segmentation faults, undefined behavior, etc.
|
||||
|
||||
Thus Cyclone ensures memory safety by automatically relocating objects to the heap before they can be accessed by more than one thread. Each write barrier checks to see if a heap variable is being changed to point to a variable on the stack. When such a change is detected Cyclone will move only that object to the heap if possible. However for objects with many children - such as a list or vector - it may be necessary for Cyclone to trigger a minor collection in order to ensure all objects are relocated to the heap before they can be accessed by multiple threads. The following function does the heavy lifting:
|
||||
Thus Cyclone ensures memory safety by automatically relocating objects to the heap before they can be accessed by more than one thread. Each write barrier checks to see if a heap variable is being changed to point to a variable on the stack. When such a change is detected Cyclone will move only that object to the heap if possible. However for objects with many children - such as a list or vector - it may be necessary for Cyclone to trigger a minor collection in order to ensure all objects are relocated to the heap before they can be accessed by multiple threads.
|
||||
|
||||
The following function does the heavy lifting:
|
||||
|
||||
object transport_stack_value(gc_thread_data *data, object var, object value, int *run_gc)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue