diff options
| author | Frank Denis <github@pureftpd.org> | 2024-03-19 13:11:33 +0100 |
|---|---|---|
| committer | Frank Denis <github@pureftpd.org> | 2024-03-19 13:11:33 +0100 |
| commit | 9b454a8ce241cf02e2869942c67a6d7871a52fb3 (patch) | |
| tree | 6f0f9584c641196267158086e2fe8c771899db7d /lib/std/Thread.zig | |
| parent | c470016743474cd4686ddb523652b4ad7c7ef42f (diff) | |
| download | zig-9b454a8ce241cf02e2869942c67a6d7871a52fb3.tar.gz zig-9b454a8ce241cf02e2869942c67a6d7871a52fb3.zip | |
WASI-thread: panic if no allocator is given
Diffstat (limited to 'lib/std/Thread.zig')
| -rw-r--r-- | lib/std/Thread.zig | 5 |
1 files changed, 1 insertions, 4 deletions
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. |
