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 /test/cli.zig | |
| 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 'test/cli.zig')
| -rw-r--r-- | test/cli.zig | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/test/cli.zig b/test/cli.zig index e68bd35167..6d0b09785f 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -8,10 +8,7 @@ const ChildProcess = std.ChildProcess; var a: *std.mem.Allocator = undefined; pub fn main() !void { - var direct_allocator = std.heap.DirectAllocator.init(); - defer direct_allocator.deinit(); - - var arena = std.heap.ArenaAllocator.init(&direct_allocator.allocator); + var arena = std.heap.ArenaAllocator.init(std.heap.direct_allocator); defer arena.deinit(); var arg_it = process.args(); |
