mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix bug in temp allocator when temp memory is exhausted and allocation needs overaligned mem. #1715
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user