mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Freestanding - default to nil allocator; wasm - default to panic allocator
This commit is contained in:
+10
-1
@@ -1475,6 +1475,16 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bc->metrics.os == TargetOs_freestanding) {
|
||||||
|
bc->ODIN_DEFAULT_TO_NIL_ALLOCATOR = !bc->ODIN_DEFAULT_TO_PANIC_ALLOCATOR;
|
||||||
|
} else if (is_arch_wasm()) {
|
||||||
|
if (bc->metrics.os == TargetOs_js || bc->metrics.os == TargetOs_wasi) {
|
||||||
|
// TODO(bill): Should these even have a default "heap-like" allocator?
|
||||||
|
}
|
||||||
|
bc->ODIN_DEFAULT_TO_PANIC_ALLOCATOR = true;
|
||||||
|
bc->ODIN_DEFAULT_TO_NIL_ALLOCATOR = !bc->ODIN_DEFAULT_TO_PANIC_ALLOCATOR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(GB_SYSTEM_WINDOWS)
|
#if defined(GB_SYSTEM_WINDOWS)
|
||||||
@@ -1609,7 +1619,6 @@ gb_internal bool init_build_paths(String init_filename) {
|
|||||||
produces_output_file = true;
|
produces_output_file = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (build_context.ODIN_DEFAULT_TO_NIL_ALLOCATOR ||
|
if (build_context.ODIN_DEFAULT_TO_NIL_ALLOCATOR ||
|
||||||
build_context.ODIN_DEFAULT_TO_PANIC_ALLOCATOR) {
|
build_context.ODIN_DEFAULT_TO_PANIC_ALLOCATOR) {
|
||||||
bc->no_dynamic_literals = true;
|
bc->no_dynamic_literals = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user