__stdio_init();
}
-_thread_start :: (id: i32, tls_base: rawptr, func: (data: rawptr) -> void, data: rawptr) {
- __tls_base = tls_base;
- context.thread_id = id;
+#if Multi_Threading_Enabled {
+ _thread_start :: (id: i32, tls_base: rawptr, func: (data: rawptr) -> void, data: rawptr) {
+ __tls_base = tls_base;
+ context.thread_id = id;
- __stack_top = raw_alloc(alloc.heap_allocator, 1 << 20);
- __thread_initialize();
+ __stack_top = raw_alloc(alloc.heap_allocator, 1 << 20);
+ __thread_initialize();
- func(data);
+ func(data);
- __flush_stdio();
-}
+ __flush_stdio();
+ }
-_thread_exit :: (id: i32) {
- raw_free(alloc.heap_allocator, __tls_base);
+ _thread_exit :: (id: i32) {
+ thread :: package core.thread
- thread.__exited(id);
-}
+ raw_free(alloc.heap_allocator, __tls_base);
+ thread.__exited(id);
+ }
+}
\ No newline at end of file
.kind = WASM_FOREIGN_MEMORY,
.min = 1024,
.max = 65536, // NOTE: Why not use all 4 Gigs of memory?
- .shared = context.options->runtime != Runtime_Onyx,
+ .shared = context.options->runtime == Runtime_Js,
.mod = "onyx",
.name = "memory",