diff options
Diffstat (limited to 'docs/type_system/gc.md')
| -rw-r--r-- | docs/type_system/gc.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/type_system/gc.md b/docs/type_system/gc.md new file mode 100644 index 0000000..3fcf88e --- /dev/null +++ b/docs/type_system/gc.md @@ -0,0 +1,35 @@ +# Gc + +--- + +Hold multiple references to the same object + +```text +Gc[Type; GC_FLAGS] +``` + +# Alias + +```text +Shared[Generic.T] `alias Gc[Generic.T; GC_FLAGS] +``` + +## `GC_FLAGS` + +### Lock Mutex + +The shared type has been detected across asynchronous tasks and needs to lock the mutex on mutation + +# Garbage Collection + +A tracing mark and sweep garbage collector is used + +# Mutating + +```text +x : Shared[Array] $ (1; 2; 3) +^ x {[y] + y `push 4 +} +`log x // Shared[Array[I64]] $ (1; 2; 3; 4) +``` |
