From 1aa0215b6e3139c6f1ea49e9a9b1266f5850b51b Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 02:42:53 +0330 Subject: 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 --- docs/SPEC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') 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 -- cgit v1.2.3