| ... | @@ -3,8 +3,10 @@ const assert = std.debug.assert; | ... | @@ -3,8 +3,10 @@ const assert = std.debug.assert; |
| 3 | const mem = std.mem; | 3 | const mem = std.mem; |
| 4 | const Allocator = std.mem.Allocator; | 4 | const Allocator = std.mem.Allocator; |
| 5 | | 5 | |
| 6 | /// This allocator takes an existing allocator, wraps it, and provides an interface | 6 | /// This allocator takes an existing allocator, wraps it, and provides an interface where |
| 7 | /// where you can allocate without freeing, and then free it all together. | 7 | /// you can allocate and then free it all together. Calls to free an individual item only |
| | 8 | /// free the item if it was the most recent allocation, otherwise calls to free do |
| | 9 | /// nothing. |
| 8 | pub const ArenaAllocator = struct { | 10 | pub const ArenaAllocator = struct { |
| 9 | child_allocator: Allocator, | 11 | child_allocator: Allocator, |
| 10 | state: State, | 12 | state: State, |