Skip to content

Commit 6e0f518

Browse files
committed
Remove HEAP_PANIC_ON_FREE_NIL
1 parent c625bc9 commit 6e0f518

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

base/runtime/heap_allocator_implementation.odin

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ HEAP_MIN_BIN_SIZE :: #config(ODIN_HEAP_MIN_BIN_SIZE, 8 * Byte)
5252
HEAP_MAX_EMPTY_ORPHANED_SUPERPAGES :: #config(ODIN_HEAP_MAX_EMPTY_ORPHANED_SUPERPAGES, 3)
5353
HEAP_SUPERPAGE_CACHE_RATIO :: #config(ODIN_HEAP_SUPERPAGE_CACHE_RATIO, 20)
5454
HEAP_PANIC_ON_DOUBLE_FREE :: #config(ODIN_HEAP_PANIC_ON_DOUBLE_FREE, true)
55-
HEAP_PANIC_ON_FREE_NIL :: #config(ODIN_HEAP_PANIC_ON_FREE_NIL, false)
5655

5756
//
5857
// Constants
@@ -1557,11 +1556,7 @@ Free memory returned by `heap_alloc`.
15571556
heap_free :: proc "contextless" (ptr: rawptr) {
15581557
// Check for nil.
15591558
if ptr == nil {
1560-
when HEAP_PANIC_ON_FREE_NIL {
1561-
panic_contextless("The heap allocator was given a nil pointer to free.")
1562-
} else {
1563-
return
1564-
}
1559+
return
15651560
}
15661561

15671562
superpage := find_superpage_from_pointer(ptr)

0 commit comments

Comments
 (0)