diff options
| author | Sahnvour <sahnvour@pm.me> | 2019-06-22 16:33:00 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-22 14:10:53 -0400 |
| commit | 987c209b407f8379fd58381dcd3975982dfccdaf (patch) | |
| tree | 6437a6aa96b60175c23a4eca8e9fad257ba440e2 /src-self-hosted | |
| parent | be51511d295269851ea4128f0fd3db49fe96a661 (diff) | |
| download | zig-987c209b407f8379fd58381dcd3975982dfccdaf.tar.gz zig-987c209b407f8379fd58381dcd3975982dfccdaf.zip | |
heap: make one global instance of DirectAllocator
it is now stateless, so the de/init are not necessary anymore
Diffstat (limited to 'src-self-hosted')
| -rw-r--r-- | src-self-hosted/dep_tokenizer.zig | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src-self-hosted/dep_tokenizer.zig b/src-self-hosted/dep_tokenizer.zig index 796202499a..2721944451 100644 --- a/src-self-hosted/dep_tokenizer.zig +++ b/src-self-hosted/dep_tokenizer.zig @@ -837,12 +837,11 @@ test "error prereq - continuation expecting end-of-line" { // - tokenize input, emit textual representation, and compare to expect fn depTokenizer(input: []const u8, expect: []const u8) !void { - var direct_allocator = std.heap.DirectAllocator.init(); - var arena_allocator = std.heap.ArenaAllocator.init(&direct_allocator.allocator); + var arena_allocator = std.heap.ArenaAllocator.init(std.heap.direct_allocator); const arena = &arena_allocator.allocator; defer arena_allocator.deinit(); - var it = Tokenizer.init(&direct_allocator.allocator, input); + var it = Tokenizer.init(arena, input); var buffer = try std.Buffer.initSize(arena, 0); var i: usize = 0; while (true) { |
