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{...@@ -324,9 +324,6 @@ pub const SpawnError = error{
324 /// would exceed the limit.324 /// would exceed the limit.
325 LockedMemoryLimitExceeded,325 LockedMemoryLimitExceeded,
326326
327 /// An allocator is required to spawn a thread
328 AllocatorRequired,
329
330 Unexpected,327 Unexpected,
331};328};
332329
...@@ -836,7 +833,7 @@ const WasiThreadImpl = struct {...@@ -836,7 +833,7 @@ const WasiThreadImpl = struct {
836833
837 fn spawn(config: std.Thread.SpawnConfig, comptime f: anytype, args: anytype) SpawnError!WasiThreadImpl {834 fn spawn(config: std.Thread.SpawnConfig, comptime f: anytype, args: anytype) SpawnError!WasiThreadImpl {
838 if (config.allocator == null) {835 if (config.allocator == null) {
839 return error.AllocatorRequired; // an allocator is required to spawn a WASI thread836 @panic("an allocator is required to spawn a WASI thread");
840 }837 }
841838
842 // Wrapping struct required to hold the user-provided function arguments.839 // Wrapping struct required to hold the user-provided function arguments.