aboutsummaryrefslogtreecommitdiff
path: root/docs/SPEC.md
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 02:39:49 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 02:40:51 +0330
commit7ff224faa88725fe59441e73c70dfa4eedd76345 (patch)
tree2c8af51b9fc3ea3efe45e43ac0c8ab38ab709fe8 /docs/SPEC.md
parentrt: memreport marks a leaked value whose drop never ran with (drop); spec 4.1... (diff)
o3: break and continue out of an o3 { } block call rt.o3_leave for each block they leave (the loop records the o3 depth it began at), so the depth returns to 0 and pending collections and drops run; spec 4.10.3, o3_break_continue_leave.zc
Diffstat (limited to 'docs/SPEC.md')
-rw-r--r--docs/SPEC.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/SPEC.md b/docs/SPEC.md
index bb0f44f..c80b220 100644
--- a/docs/SPEC.md
+++ b/docs/SPEC.md
@@ -624,7 +624,7 @@ switch (s) { case circle(r): pn(r); case rect(w, h): pn(w * h); case dot: ps("do
o3 int sum(fixed int[?] a) { int s = 0; for (int i = 0; i < len(a); i++) s += a[i]; return s; }
```
-4.10.3 no collection runs inside an o3 region, from any code path. an allocation that would collect grows the heap instead and leaves a collection pending; an explicit `rt.gc()` inside the region is pending too. when the outermost region is left (the end of an `o3 { }` block, a `return` out of it, or the return of an o3 function called from normal code), the pending collection runs once. if the heap can't grow, the allocation is a runtime trap (out of heap memory, exit status 2).
+4.10.3 no collection runs inside an o3 region, from any code path. an allocation that would collect grows the heap instead and leaves a collection pending; an explicit `rt.gc()` inside the region is pending too. when the outermost region is left (the end of an `o3 { }` block, a `return`, `break` or `continue` out of it, or the return of an o3 function called from normal code), the pending collection runs once. if the heap can't grow, the allocation is a runtime trap (out of heap memory, exit status 2).
4.10.4 drops (6.15) don't run inside o3: setting a drop inside an o3 region is error: a drop can't be set inside an o3 region, and ending the lifetime of a value with a drop inside an o3 region, by `rt.free`, at a scope end, or as a temporary, is error: x: has drop and can't end inside an o3 region. a drop the compiler can't see (unchecked code) that comes to run inside o3 stops the program: zy: a drop can't run inside an o3 region.
### 4.11 memdebug