mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
change default WASI stack size
to match the other operating systems. 16 MiB closes #18885
This commit is contained in:
parent
031f23117d
commit
d51aa9748f
4 changed files with 10 additions and 16 deletions
|
|
@ -79,9 +79,9 @@ const fixedBufferStream = std.io.fixedBufferStream;
|
||||||
const print = std.debug.print;
|
const print = std.debug.print;
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
test "flate" {
|
test {
|
||||||
_ = @import("flate/deflate.zig");
|
_ = deflate;
|
||||||
_ = @import("flate/inflate.zig");
|
_ = inflate;
|
||||||
}
|
}
|
||||||
|
|
||||||
test "flate compress/decompress" {
|
test "flate compress/decompress" {
|
||||||
|
|
|
||||||
|
|
@ -530,9 +530,7 @@ fn SimpleCompressor(
|
||||||
|
|
||||||
const builtin = @import("builtin");
|
const builtin = @import("builtin");
|
||||||
|
|
||||||
test "flate.Deflate tokenization" {
|
test "tokenization" {
|
||||||
if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
|
|
||||||
|
|
||||||
const L = Token.initLiteral;
|
const L = Token.initLiteral;
|
||||||
const M = Token.initMatch;
|
const M = Token.initMatch;
|
||||||
|
|
||||||
|
|
@ -607,9 +605,7 @@ const TestTokenWriter = struct {
|
||||||
pub fn flush(_: *Self) !void {}
|
pub fn flush(_: *Self) !void {}
|
||||||
};
|
};
|
||||||
|
|
||||||
test "flate deflate file tokenization" {
|
test "file tokenization" {
|
||||||
if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
|
|
||||||
|
|
||||||
const levels = [_]Level{ .level_4, .level_5, .level_6, .level_7, .level_8, .level_9 };
|
const levels = [_]Level{ .level_4, .level_5, .level_6, .level_7, .level_8, .level_9 };
|
||||||
const cases = [_]struct {
|
const cases = [_]struct {
|
||||||
data: []const u8, // uncompressed content
|
data: []const u8, // uncompressed content
|
||||||
|
|
@ -718,7 +714,7 @@ fn TokenDecoder(comptime WriterType: type) type {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
test "flate.Deflate store simple compressor" {
|
test "store simple compressor" {
|
||||||
const data = "Hello world!";
|
const data = "Hello world!";
|
||||||
const expected = [_]u8{
|
const expected = [_]u8{
|
||||||
0x1, // block type 0, final bit set
|
0x1, // block type 0, final bit set
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,10 @@ pub fn createEmpty(
|
||||||
.zcu_object_sub_path = zcu_object_sub_path,
|
.zcu_object_sub_path = zcu_object_sub_path,
|
||||||
.gc_sections = options.gc_sections orelse (output_mode != .Obj),
|
.gc_sections = options.gc_sections orelse (output_mode != .Obj),
|
||||||
.print_gc_sections = options.print_gc_sections,
|
.print_gc_sections = options.print_gc_sections,
|
||||||
.stack_size = options.stack_size orelse std.wasm.page_size * 16, // 1MB
|
.stack_size = options.stack_size orelse switch (target.os.tag) {
|
||||||
|
.freestanding => 1 * 1024 * 1024, // 1 MiB
|
||||||
|
else => 16 * 1024 * 1024, // 16 MiB
|
||||||
|
},
|
||||||
.allow_shlib_undefined = options.allow_shlib_undefined orelse false,
|
.allow_shlib_undefined = options.allow_shlib_undefined orelse false,
|
||||||
.file = null,
|
.file = null,
|
||||||
.disable_lld_caching = options.disable_lld_caching,
|
.disable_lld_caching = options.disable_lld_caching,
|
||||||
|
|
|
||||||
|
|
@ -1138,11 +1138,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
|
||||||
|
|
||||||
for (options.include_paths) |include_path| these_tests.addIncludePath(.{ .path = include_path });
|
for (options.include_paths) |include_path| these_tests.addIncludePath(.{ .path = include_path });
|
||||||
|
|
||||||
if (target.os.tag == .wasi) {
|
|
||||||
// WASI's default stack size can be too small for some big tests.
|
|
||||||
these_tests.stack_size = 2 * 1024 * 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}", .{
|
const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}", .{
|
||||||
options.name,
|
options.name,
|
||||||
triple_txt,
|
triple_txt,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue