Skip to content

Commit 7e42ebe

Browse files
committed
support 32bit architectures
* fix compile error for 32bit arches * ci: build and test 32bit executables
1 parent 0c70c69 commit 7e42ebe

File tree

2 files changed

+43
-8
lines changed

2 files changed

+43
-8
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,45 @@ on:
77
pull_request:
88

99
jobs:
10-
test:
11-
strategy:
12-
matrix:
13-
os: [windows-latest, macos-latest, ubuntu-latest]
14-
runs-on: ${{matrix.os}}
10+
test-windows:
11+
runs-on: windows-latest
1512
steps:
16-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1714
- uses: mlugg/setup-zig@v1
1815
with:
1916
version: 0.14.0
20-
- run: zig build test
17+
- run: |
18+
zig build test
19+
zig build -Dtarget=x86-windows-gnu test
20+
21+
test-macos-arm64:
22+
runs-on: macos-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: mlugg/setup-zig@v1
26+
with:
27+
version: 0.14.0
28+
- run: |
29+
zig build test
30+
31+
test-macos-x86:
32+
runs-on: macos-13
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: mlugg/setup-zig@v1
36+
with:
37+
version: 0.14.0
38+
- run: |
39+
zig build test
40+
zig build -Dtarget=x86-macos-gnu test
41+
42+
test-linux:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
- uses: mlugg/setup-zig@v1
47+
with:
48+
version: 0.14.0
49+
- run: |
50+
zig build test
51+
zig build -Dtarget=x86-linux-gnu test

stable_array.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,11 @@ test "huge max size" {
469469
const MB = KB * 1024;
470470
const GB = MB * 1024;
471471

472-
var a = StableArray(u8).init(GB * 128);
472+
const MAX_MEMORY_32 = GB * 1;
473+
const MAX_MEMORY_64 = GB * 128;
474+
const MAX_MEMORY = if (@sizeOf(usize) < @sizeOf(u64)) MAX_MEMORY_32 else MAX_MEMORY_64;
475+
476+
var a = StableArray(u8).init(MAX_MEMORY);
473477
defer a.deinit();
474478

475479
try a.resize(MB * 4);

0 commit comments

Comments
 (0)