diff options
| author | 2026-10-15 02:42:53 +0330 | |
|---|---|---|
| committer | 2026-10-15 02:42:53 +0330 | |
| commit | 1aa0215b6e3139c6f1ea49e9a9b1266f5850b51b (patch) | |
| tree | db648d1a197bc44e7c803e2631f05c475c96ffb1 /docs/SPEC.md | |
| parent | o3: break and continue out of an o3 { } block call rt.o3_leave for each block... (diff) | |
o3: an o3 function called from normal code as a receiver method (run.method) enters and leaves the region and fattens its result, like a direct call; spec 4.10.3, o3_receiver_method_enter.zc
Diffstat (limited to 'docs/SPEC.md')
| -rw-r--r-- | docs/SPEC.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/SPEC.md b/docs/SPEC.md index c80b220..1aa135a 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`, `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.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, directly or as a receiver method), 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 |
