You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 24424f7
Browse filesBrowse the repository at this point in the historyBrowse files
atomics: ACell[A], an atomic word (I64, U64, Ptr) whose load, store, cas and fetchAdd are the C __atomic builtins with their memory order (acquire, release, acq_rel, seq_cst); each op is a request on the capability Atomic (handler Srs.Atomic), so plain code cannot touch an atomic word. Programs without ACell emit the same C; s2c self-compile instructions unchanged (5.0005 G). Tests prog/atomic, neg atom_list, atom_nocap, atom_noeffect; the gate checks every emitted call carries its own order (#103)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ Every change to srs that lands, newest first. A project that builds with srs (sn
4
4
5
5
## Unreleased
6
6
7
+
- atomics: `ACell[A]` is an atomic word (A is I64, U64 or Ptr). `ACell.new(v)` makes one in the innermost Region; `ACell.load(c)`, `ACell.store(c, v)`, `ACell.cas(c, want, v)` (a Bool) and `ACell.fetchAdd(c, d)` (the word before the add) are the C `__atomic` builtins with their memory order: load acquire, store release, cas acq_rel (failure acquire), fetchAdd seq_cst. Each op is a request on the new capability `Atomic` (handler `Srs.Atomic`), so plain code cannot touch an atomic word (`error[unhandled-effect]`). A cell of a non-word type is `error[mismatch]`. Programs without ACell emit the same C as before; s2c compiling itself: 5.0005 G instructions, same as before. The `--mem` goldens list the new handler's var.
8
+
7
9
- emit: the scratch copy-out searches the scratch's chunk table once per box (the copy function hands the chunk to `srs_ev_get` and `srs_ev_dup`; before, `srs_ev_in`, `srs_ev_get` and `srs_ev_put` each ran the binary search), and a pointer outside the span of the scratch's chunks is settled by two compares. s2c compiling itself: 6.15 -> 4.94 G instructions (-19.7%), user 1.7 -> 1.5 s, same peak, same program semantics (the emitted prims text changes: new seed).
8
10
9
11
- rt: a Console capture reuses the buffer of the last ended capture and returns its text as a tight copy; before, every capture kept its own fresh 4 KiB malloc block for the program's lifetime. s2c compiling itself (7,468 captures in `Mem.fresh`): page faults 8,617 -> 1,214 (-86%), peak RSS 417.5 -> 387.9 MB, same output. Test `tests/s2/prog/capture_many.srs`: 20,000 captures keep the peak flat (the old runtime grew it by 79 MB).
0 commit comments