| ... | @@ -368,9 +368,9 @@ pub const ArenaAllocator = struct { | ... | @@ -368,9 +368,9 @@ pub const ArenaAllocator = struct { |
| 368 | var it = self.buffer_list.first; | 368 | var it = self.buffer_list.first; |
| 369 | while (it) |node| { | 369 | while (it) |node| { |
| 370 | // this has to occur before the free because the free frees node | 370 | // this has to occur before the free because the free frees node |
| 371 | it = node.next; | 371 | const next_it = node.next; |
| 372 | | | |
| 373 | self.child_allocator.free(node.data); | 372 | self.child_allocator.free(node.data); |
| | 373 | it = next_it; |
| 374 | } | 374 | } |
| 375 | } | 375 | } |
| 376 | | 376 | |
| ... | @@ -764,18 +764,18 @@ test "HeapAllocator" { | ... | @@ -764,18 +764,18 @@ test "HeapAllocator" { |
| 764 | } | 764 | } |
| 765 | } | 765 | } |
| 766 | | 766 | |
| 767 | //test "ArenaAllocator" { | 767 | test "ArenaAllocator" { |
| 768 | // var direct_allocator = DirectAllocator.init(); | 768 | var direct_allocator = DirectAllocator.init(); |
| 769 | // defer direct_allocator.deinit(); | 769 | defer direct_allocator.deinit(); |
| 770 | // | 770 | |
| 771 | // var arena_allocator = ArenaAllocator.init(&direct_allocator.allocator); | 771 | var arena_allocator = ArenaAllocator.init(&direct_allocator.allocator); |
| 772 | // defer arena_allocator.deinit(); | 772 | defer arena_allocator.deinit(); |
| 773 | // | 773 | |
| 774 | // try testAllocator(&arena_allocator.allocator); | 774 | try testAllocator(&arena_allocator.allocator); |
| 775 | // try testAllocatorAligned(&arena_allocator.allocator, 16); | 775 | try testAllocatorAligned(&arena_allocator.allocator, 16); |
| 776 | // try testAllocatorLargeAlignment(&arena_allocator.allocator); | 776 | try testAllocatorLargeAlignment(&arena_allocator.allocator); |
| 777 | // try testAllocatorAlignedShrink(&arena_allocator.allocator); | 777 | try testAllocatorAlignedShrink(&arena_allocator.allocator); |
| 778 | //} | 778 | } |
| 779 | | 779 | |
| 780 | var test_fixed_buffer_allocator_memory: [80000 * @sizeOf(u64)]u8 = undefined; | 780 | var test_fixed_buffer_allocator_memory: [80000 * @sizeOf(u64)]u8 = undefined; |
| 781 | test "FixedBufferAllocator" { | 781 | test "FixedBufferAllocator" { |