From 9b454a8ce241cf02e2869942c67a6d7871a52fb3 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 19 Mar 2024 13:11:33 +0100 Subject: WASI-thread: panic if no allocator is given --- lib/std/Thread.zig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index 6866a1702d..ec1fef22bb 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -324,9 +324,6 @@ pub const SpawnError = error{ /// would exceed the limit. LockedMemoryLimitExceeded, - /// An allocator is required to spawn a thread - AllocatorRequired, - Unexpected, }; @@ -836,7 +833,7 @@ const WasiThreadImpl = struct { fn spawn(config: std.Thread.SpawnConfig, comptime f: anytype, args: anytype) SpawnError!WasiThreadImpl { if (config.allocator == null) { - return error.AllocatorRequired; // an allocator is required to spawn a WASI thread + @panic("an allocator is required to spawn a WASI thread"); } // Wrapping struct required to hold the user-provided function arguments. -- cgit v1.2.3