Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit e323a10

Browse files
andrewrkRossComputerGuy
authored andcommitted
change default WASI stack size
to match the other operating systems. 16 MiB closes ziglang#18885
1 parent 381520b commit e323a10

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

lib/std/compress/flate.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ const fixedBufferStream = std.io.fixedBufferStream;
7979
const print = std.debug.print;
8080
const builtin = @import("builtin");
8181

82-
test "flate" {
83-
_ = @import("flate/deflate.zig");
84-
_ = @import("flate/inflate.zig");
82+
test {
83+
_ = deflate;
84+
_ = inflate;
8585
}
8686

8787
test "flate compress/decompress" {

lib/std/compress/flate/deflate.zig

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ fn SimpleCompressor(
530530

531531
const builtin = @import("builtin");
532532

533-
test "flate.Deflate tokenization" {
534-
if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
535-
533+
test "tokenization" {
536534
const L = Token.initLiteral;
537535
const M = Token.initMatch;
538536

@@ -607,9 +605,7 @@ const TestTokenWriter = struct {
607605
pub fn flush(_: *Self) !void {}
608606
};
609607

610-
test "flate deflate file tokenization" {
611-
if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
612-
608+
test "file tokenization" {
613609
const levels = [_]Level{ .level_4, .level_5, .level_6, .level_7, .level_8, .level_9 };
614610
const cases = [_]struct {
615611
data: []const u8, // uncompressed content
@@ -718,7 +714,7 @@ fn TokenDecoder(comptime WriterType: type) type {
718714
};
719715
}
720716

721-
test "flate.Deflate store simple compressor" {
717+
test "store simple compressor" {
722718
const data = "Hello world!";
723719
const expected = [_]u8{
724720
0x1, // block type 0, final bit set

src/link/Wasm.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,10 @@ pub fn createEmpty(
418418
.zcu_object_sub_path = zcu_object_sub_path,
419419
.gc_sections = options.gc_sections orelse (output_mode != .Obj),
420420
.print_gc_sections = options.print_gc_sections,
421-
.stack_size = options.stack_size orelse std.wasm.page_size * 16, // 1MB
421+
.stack_size = options.stack_size orelse switch (target.os.tag) {
422+
.freestanding => 1 * 1024 * 1024, // 1 MiB
423+
else => 16 * 1024 * 1024, // 16 MiB
424+
},
422425
.allow_shlib_undefined = options.allow_shlib_undefined orelse false,
423426
.file = null,
424427
.disable_lld_caching = options.disable_lld_caching,

test/tests.zig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,11 +1138,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
11381138

11391139
for (options.include_paths) |include_path| these_tests.addIncludePath(.{ .path = include_path });
11401140

1141-
if (target.os.tag == .wasi) {
1142-
// WASI's default stack size can be too small for some big tests.
1143-
these_tests.stack_size = 2 * 1024 * 1024;
1144-
}
1145-
11461141
const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}", .{
11471142
options.name,
11481143
triple_txt,

0 commit comments

Comments
 (0)