aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-04-28 15:21:45 +0100
committerGitHub <noreply@github.com>2024-04-28 15:21:45 +0100
commit0eb97dba6e7c43f90b53f7f4ea2f2668cf7b7ff6 (patch)
tree2db4946720c6230a712912941c3e14222f9c70c1 /src
parentfa5e6d2d84d2a283aa9a93db6acc5ce9e85d6909 (diff)
parent4fea5720a52b726671a1e6f8e9acfe0ee2569972 (diff)
Merge pull request #3496 from laytan/allow-default-to-nil-allocator-on-wasm
wasm: allow `-default-to-nil-allocator`
Diffstat (limited to 'src')
-rw-r--r--src/build_settings.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp
index 3bd362996..8509394ff 100644
--- a/src/build_settings.cpp
+++ b/src/build_settings.cpp
@@ -1583,8 +1583,10 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
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 (!bc->ODIN_DEFAULT_TO_NIL_ALLOCATOR && !bc->ODIN_DEFAULT_TO_PANIC_ALLOCATOR) {
+ bc->ODIN_DEFAULT_TO_PANIC_ALLOCATOR = true;
+ }
}
}