Fix bug in temp allocator when temp memory is exhausted and allocation needs overaligned mem. #1715

This commit is contained in:
Christoffer Lerno
2024-12-25 17:56:37 +01:00
parent 7424317d03
commit 17942925f5
2 changed files with 4 additions and 1 deletions

View File

@@ -179,8 +179,10 @@ fn void*! TempAllocator.acquire(&self, usz size, AllocInitType init_type, usz al
{
mem = allocator::malloc_aligned(self.backing_allocator, total_alloc_size, alignment)!;
}
void* start = mem;
mem += mem::aligned_offset(TempAllocatorPage.sizeof, alignment);
page = (TempAllocatorPage*)mem - 1;
page.start = mem;
page.start = start;
page.size = size | PAGE_IS_ALIGNED;
}
else

View File

@@ -20,6 +20,7 @@
- Fix CRT detection on Arch Linux.
- Fix lexer allowing a trailing underscore (_) with hex and binary literals.
- Fix `--list-operators` CLI command printing underscore (_) and hash (#).
- Fix bug in temp allocator when temp memory is exhausted and allocation needs overaligned mem. #1715
### Stdlib changes
- Increase BitWriter.write_bits limit up to 32 bits.