Remove broken free check on temp allocator.

This commit is contained in:
Christoffer Lerno
2023-06-25 22:07:44 +02:00
parent f878191e6f
commit 0ec64c3be8

View File

@@ -88,8 +88,6 @@ fn void*! temp_allocator_function(Allocator* data, usz size, usz alignment, usz
fn void! TempAllocator._free(TempAllocator* this, void* old_pointer) @local fn void! TempAllocator._free(TempAllocator* this, void* old_pointer) @local
{ {
// TODO fix free
assert((uptr)old_pointer >= (uptr)&this.data, "Pointer originates from a different allocator.");
usz old_size = *(usz*)(old_pointer - DEFAULT_SIZE_PREFIX); usz old_size = *(usz*)(old_pointer - DEFAULT_SIZE_PREFIX);
if (old_pointer + old_size == &this.data[this.used]) if (old_pointer + old_size == &this.data[this.used])
{ {