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