This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const expectEqual = std.testing.expectEqual; | |
/// Called instead of ArenaAllocator.init to ensure that the arena allocator | |
/// does not become invalid when the arena struct is moved. | |
/// | |
/// The ArenaAllocator is placed in the arena itself, and therefore the returned | |
/// pointer to the arena is stable. This means the allocator returned by | |
/// arena.allocator(), which contains a pointer to the arena struct, is also | |
/// stable. |