diff --git a/lib/std/core/allocators/temp_allocator.c3 b/lib/std/core/allocators/temp_allocator.c3 index 1349c4de8..698b4e991 100644 --- a/lib/std/core/allocators/temp_allocator.c3 +++ b/lib/std/core/allocators/temp_allocator.c3 @@ -101,7 +101,7 @@ private fn void! TempAllocator._free(TempAllocator* this, void* old_pointer) private fn void! TempAllocator._reset(TempAllocator* this, usize mark) { TempAllocatorPage *last_page = this.last_page; - while (last_page && last_page.mark >= mark) + while (last_page && last_page.mark > mark) { TempAllocatorPage *to_free = last_page; last_page = last_page.prev_page; @@ -231,7 +231,7 @@ private fn void*! TempAllocator._alloc(TempAllocator* this, usize size, usize al // Mark it as a page page.ident = ~(usize)0; // Store when it was created - page.mark = this.used; + page.mark = ++this.used; // Hook up the page. page.prev_page = this.last_page; this.last_page = page;