Skip to content

Commit 9b454a8

Browse files
committed
WASI-thread: panic if no allocator is given
1 parent c470016 commit 9b454a8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/std/Thread.zig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,6 @@ pub const SpawnError = error{
324324
/// would exceed the limit.
325325
LockedMemoryLimitExceeded,
326326

327-
/// An allocator is required to spawn a thread
328-
AllocatorRequired,
329-
330327
Unexpected,
331328
};
332329

@@ -836,7 +833,7 @@ const WasiThreadImpl = struct {
836833

837834
fn spawn(config: std.Thread.SpawnConfig, comptime f: anytype, args: anytype) SpawnError!WasiThreadImpl {
838835
if (config.allocator == null) {
839-
return error.AllocatorRequired; // an allocator is required to spawn a WASI thread
836+
@panic("an allocator is required to spawn a WASI thread");
840837
}
841838

842839
// Wrapping struct required to hold the user-provided function arguments.

0 commit comments

Comments
 (0)