Fix total_size calculation for memory_block_alloc

This commit is contained in:
gingerBill
2026-09-02 13:02:38 +01:00
parent 2f3baf40c0
commit b245c44036

View File

@@ -82,7 +82,7 @@ memory_block_alloc :: proc(committed, reserved: uint, alignment: uint = 0, flags
reserved = align_formula(reserved, page_size)
committed = clamp(committed, 0, reserved)
total_size := reserved + alignment + size_of(Platform_Memory_Block)
total_size := reserved + 2*alignment + size_of(Platform_Memory_Block)
base_offset := mem.align_forward_uintptr(size_of(Platform_Memory_Block), max(uintptr(alignment), align_of(Platform_Memory_Block)))
protect_offset := uintptr(0)