authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2024-03-19 13:11:33+01:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2024-03-19 13:11:33+01:00
log9b454a8ce241cf02e2869942c67a6d7871a52fb3
tree6f0f9584c641196267158086e2fe8c771899db7d
parentc470016743474cd4686ddb523652b4ad7c7ef42f

WASI-thread: panic if no allocator is given


1 files changed, 1 insertions(+), 4 deletions(-)

lib/std/Thread.zig+1-4
......@@ -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.