mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Handle freeing nil in scratch allocator
This commit is contained in:
@@ -217,6 +217,9 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
|
|||||||
return ptr, err
|
return ptr, err
|
||||||
|
|
||||||
case .Free:
|
case .Free:
|
||||||
|
if old_memory == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
start := uintptr(raw_data(s.data))
|
start := uintptr(raw_data(s.data))
|
||||||
end := start + uintptr(len(s.data))
|
end := start + uintptr(len(s.data))
|
||||||
old_ptr := uintptr(old_memory)
|
old_ptr := uintptr(old_memory)
|
||||||
|
|||||||
Reference in New Issue
Block a user