From: Brendan Hansen Date: Mon, 18 Oct 2021 00:49:35 +0000 (-0500) Subject: bugfix with context not being initialized yet X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=d0007c3be0133c196f98995ac8849db9814e4fa2;p=onyx.git bugfix with context not being initialized yet --- diff --git a/core/runtime/js.onyx b/core/runtime/js.onyx index 18f3e18a..2ad858d7 100644 --- a/core/runtime/js.onyx +++ b/core/runtime/js.onyx @@ -22,7 +22,7 @@ __exit :: (status: i32) -> void #foreign "host" "exit" --- __spawn_thread :: (id: i32, func: (data: rawptr) -> void, data: rawptr) -> bool #foreign "host" "spawn_thread" --- #export "_thread_start" (func: (data: rawptr) -> void, data: rawptr) { - __stack_top = raw_alloc(context.allocator, 1 << 20); + __stack_top = raw_alloc(alloc.heap_allocator, 1 << 20); __thread_initialize(); func(data); @@ -32,7 +32,7 @@ __exit :: (status: i32) -> void #foreign "host" "exit" --- #export "_thread_exit" (id: i32) { // raw_free(context.allocator, __stack_top); - raw_free(context.allocator, __tls_base); + raw_free(alloc.heap_allocator, __tls_base); thread.__exited(id); } diff --git a/core/threads/thread.onyx b/core/threads/thread.onyx index c4597362..8ee99cb6 100644 --- a/core/threads/thread.onyx +++ b/core/threads/thread.onyx @@ -43,7 +43,7 @@ __exited :: (id: i32) { if thread != null { thread.alive = false; __atomic_notify(^thread.id); - + thread_map->delete(id); } }