mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Add comment for the internals of assert
This commit is contained in:
@@ -614,6 +614,10 @@ raw_data :: proc{raw_array_data, raw_slice_data, raw_dynamic_array_data, raw_str
|
|||||||
@(disabled=ODIN_DISABLE_ASSERT)
|
@(disabled=ODIN_DISABLE_ASSERT)
|
||||||
assert :: proc(condition: bool, message := "", loc := #caller_location) {
|
assert :: proc(condition: bool, message := "", loc := #caller_location) {
|
||||||
if !condition {
|
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) {
|
proc(message: string, loc: Source_Code_Location) {
|
||||||
p := context.assertion_failure_proc
|
p := context.assertion_failure_proc
|
||||||
if p == nil {
|
if p == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user