aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-01-23 22:01:54 +0000
committergingerBill <bill@gingerbill.org>2022-01-23 22:01:54 +0000
commitd269dbcd40d5b81f060a17ed4ca89d97dafcc49c (patch)
treed7ffd71b50775ccc7c4bed29a97e6400e9b92367 /core/runtime
parent18e639f59b411a39c52339f67974a8dd76b33a6e (diff)
Add comment for the internals of `assert`
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/core_builtin.odin4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/runtime/core_builtin.odin b/core/runtime/core_builtin.odin
index 44da894c1..3bafc0b1d 100644
--- a/core/runtime/core_builtin.odin
+++ b/core/runtime/core_builtin.odin
@@ -614,6 +614,10 @@ raw_data :: proc{raw_array_data, raw_slice_data, raw_dynamic_array_data, raw_str
@(disabled=ODIN_DISABLE_ASSERT)
assert :: proc(condition: bool, message := "", loc := #caller_location) {
if !condition {
+ // NOTE(bill): This is wrapped in a procedure call
+ // to improve performance to make the CPU not
+ // execute speculatively, making it about an order of
+ // magnitude faster
proc(message: string, loc: Source_Code_Location) {
p := context.assertion_failure_proc
if p == nil {