| @@ -119,7 +119,7 @@ typedef struct tl_ctx { |
| 119 | 119 | |
| 120 | 120 | **Unboxed-int workers** (ADR 0045, Revision 2). The same for known `Int`: a worker `f$ui` on raw `int64_t`s. Because a raw result can leave the 63-bit small range (where Louise promotes to a big integer), the worker checks each add/subtract/multiply and returns `TL_INT_BAIL` on overflow — division and remainder also bail where the boxed path would panic or promote — and the direct caller recomputes the whole call with the boxed wrapper. Only functions safe to re-run (fusion's purity gate) get one, and the boundary calls the worker only for immediate or range-proven-small arguments (a boxed `Int` may be a big integer). `LOUISE_NO_UNBOX_INTS` turns them off. |
| 121 | 121 | |
| 122 | | −**`xargs` belongs to the thread** (ABI 3, ADR 0028). The scheduler points `ctx->xargs` at the running thread's 26 slots each time an actor resumes. This is safe because nothing suspends between a caller's stores and the callee's copy: generated functions copy before their preemption check, and the runtime's callers (`call_closure`, effect clauses, callbacks) call straight into generated code. Until ABI 2 the slots were part of the context: 208 of the 336 bytes of every actor. |
| 122 | +**`xargs` belongs to the thread** (ABI 3, ADR 0028). The scheduler points `ctx->xargs` at the running thread's 26 slots each time an actor resumes. This is safe because nothing suspends, and no generated code runs, between a caller's stores and the callee's copy: generated functions copy before their preemption check, and the runtime's callers (`call_closure`, effect clauses, callbacks) call straight into generated code. The one exception, a `ctl` clause's call (`handlers.rs`), drops the operation's payload in between: freeing runs no Louise code (a suspended handler fiber is leaked, not resumed, and a resource's finalizer is C that must not touch Louise values). The invariant holds by this argument; nothing checks it at run time (issue #217). Until ABI 2 the slots were part of the context: 208 of the 336 bytes of every actor. |
| 123 | 123 | |
| 124 | 124 | **Ownership:** |
| 125 | 125 | - Every function returns a `tl_value`, owned by the caller. |
| @@ -371,7 +371,8 @@ Issue #35. Generated C carries `#line` directives, so C compiler errors, sanitiz |
| 371 | 371 | ## Known limitations |
| 372 | 372 | |
| 373 | 373 | - A cycle through `Ref`s lives until its region ends, which clears the region's references (ADR 0002, Revision 1); reference counting alone cannot reclaim it. |
| 374 | | −- An `rc` overflow beyond 2^31 references is not handled. |
| 374 | +- An `rc` overflow beyond 2^31 references is not handled, in either direction: `tl_dup`'s `rc + 1` on an `int32_t` is undefined at `INT32_MAX`, and a shared count's `fetch_sub` wraps from `i32::MIN` to a positive (local) count (issue #217). |
| 375 | +- Handler fibers are not pooled, unlike actor stacks: each `handle` of an effect with `ctl` or `multi ctl` operations maps a fresh 16 MiB stack and unmaps it after. Measured on 2026-10-27 (native release, x86-64): about 8.5 µs per such `handle`, against 60 ns for a handler of `fn` operations, with one page fault each. Handlers whose operations are all `final ctl` (early `return`, exceptions) run no fiber and are not affected (issue #217). |
| 375 | 376 | - A Rust panic inside an `extern "C"` entry point aborts the process. That is acceptable for runtime bugs (`expect("louise: ...")`), but not for user errors, which use `tl_panic`. |
| 376 | 377 | - C bindings have no accessors for `Bytes` yet (`tl_bytes_ptr`, `tl_bytes_len`, `tl_bytes_from` are planned). |
| 377 | 378 | |