mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Add assert into scratch_allocator_proc to prevent initialization cycles #504
This commit is contained in:
@@ -116,6 +116,8 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
|
|||||||
|
|
||||||
if scratch.data == nil {
|
if scratch.data == nil {
|
||||||
DEFAULT_SCRATCH_BACKING_SIZE :: 1<<22;
|
DEFAULT_SCRATCH_BACKING_SIZE :: 1<<22;
|
||||||
|
assert(context.allocator.procedure != scratch_allocator_proc &&
|
||||||
|
context.allocator.data != allocator_data);
|
||||||
scratch_allocator_init(scratch, make([]byte, 1<<22));
|
scratch_allocator_init(scratch, make([]byte, 1<<22));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1836,4 +1836,3 @@ main :: proc() {
|
|||||||
soa_struct_layout();
|
soa_struct_layout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user