Remove unnecessary free.

This commit is contained in:
Christoffer Lerno
2026-02-10 11:46:26 +01:00
parent 0b82537700
commit c5d7a03859

View File

@@ -50,13 +50,6 @@ fn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignmen
{
if (alignment <= mem::DEFAULT_MEM_ALIGNMENT) return libc::realloc(old_ptr, new_bytes) ?: mem::OUT_OF_MEMORY~;
// Easy case, it's 0
if (!new_bytes)
{
libc::free(old_ptr);
return null;
}
// Try realloc, even though it might be unaligned.
void* new_ptr = libc::realloc(old_ptr, new_bytes) ?: mem::OUT_OF_MEMORY~!;