migrate to sx cstring era: std env() replaces local getenv/strlen, alloc_string rename

sx 1d17b0a reserves 'cstring' as the C-boundary string type and renames
std's cstring(size) allocator to alloc_string; std getenv is now
(cstring) -> ?cstring, so the local conflicting binding (caught by the
new same-symbol diagnostic) and its strlen/copy loop collapse into a
process.env delegation. iOS-sim build + 22/22 snapshots green.
This commit is contained in:
swipelab
2026-06-12 14:57:59 +03:00
parent bb728d0ab0
commit 39740a1d36
2 changed files with 3 additions and 12 deletions

View File

@@ -202,7 +202,7 @@ pick_gem :: (board: *Board, rng: *Rng, col: i64, row: i64) -> Gem {
// single gem character per cell. Suitable for snapshotting.
board_dump :: (self: *Board) -> string {
line_w := BOARD_COLS + 1; // 8 gem chars + newline
buf := cstring(BOARD_ROWS * line_w);
buf := alloc_string(BOARD_ROWS * line_w);
for 0..BOARD_ROWS (row) {
base := row * line_w;
for 0..BOARD_COLS (col) {
@@ -298,7 +298,7 @@ find_matches :: (b: *Board) -> MatchMask {
// unambiguously as the empty set. Suitable for snapshotting.
dump_matches :: (b: *Board, m: *MatchMask) -> string {
line_w := BOARD_COLS + 1; // 8 cells + newline
buf := cstring(BOARD_ROWS * line_w);
buf := alloc_string(BOARD_ROWS * line_w);
for 0..BOARD_ROWS (row) {
base := row * line_w;
for 0..BOARD_COLS (col) {