mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 21:10:30 +00:00
contextless fixes for js
This commit is contained in:
@@ -3,8 +3,8 @@ package runtime
|
||||
|
||||
init_default_context_for_js: Context
|
||||
@(init, private="file")
|
||||
init_default_context :: proc() {
|
||||
init_default_context_for_js = context
|
||||
init_default_context :: proc "contextless" () {
|
||||
__init_context(&init_default_context_for_js)
|
||||
}
|
||||
|
||||
@(export)
|
||||
|
||||
4
vendor/libc/libc.odin
vendored
4
vendor/libc/libc.odin
vendored
@@ -10,8 +10,8 @@ g_ctx: runtime.Context
|
||||
g_allocator: mem.Compat_Allocator
|
||||
|
||||
@(init)
|
||||
init_context :: proc() {
|
||||
g_ctx = context
|
||||
init_context :: proc "contextless" () {
|
||||
g_ctx = runtime.default_context()
|
||||
|
||||
// Wrapping the allocator with the mem.Compat_Allocator so we can
|
||||
// mimic the realloc semantics.
|
||||
|
||||
2
vendor/libc/stdlib.odin
vendored
2
vendor/libc/stdlib.odin
vendored
@@ -169,7 +169,7 @@ exit :: proc "c" (exit_code: c.int) -> ! {
|
||||
}
|
||||
|
||||
@(private, fini)
|
||||
finish_atexit :: proc "c" () {
|
||||
finish_atexit :: proc "contextless" () {
|
||||
n := intrinsics.atomic_exchange(&atexit_functions_count, 0)
|
||||
for function in atexit_functions[:n] {
|
||||
function()
|
||||
|
||||
2
vendor/wgpu/wgpu_js.odin
vendored
2
vendor/wgpu/wgpu_js.odin
vendored
@@ -5,7 +5,7 @@ import "base:runtime"
|
||||
g_context: runtime.Context
|
||||
|
||||
@(private="file", init)
|
||||
wgpu_init_allocator :: proc() {
|
||||
wgpu_init_allocator :: proc "contextless" () {
|
||||
if g_context.allocator.procedure == nil {
|
||||
g_context = runtime.default_context()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user