From aebce1e48e81559ffe5f496af855a1140d8e0107 Mon Sep 17 00:00:00 2001 From: nodist Date: Wed, 10 Jun 2026 10:21:32 -0400 Subject: rename shared qualifier to gc --- docs/type_system/gc.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/type_system/gc.md (limited to 'docs/type_system/gc.md') 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) +``` -- cgit v1.2.3