From 987c209b407f8379fd58381dcd3975982dfccdaf Mon Sep 17 00:00:00 2001 From: Sahnvour Date: Sat, 22 Jun 2019 16:33:00 +0200 Subject: heap: make one global instance of DirectAllocator it is now stateless, so the de/init are not necessary anymore --- std/debug.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'std/debug.zig') diff --git a/std/debug.zig b/std/debug.zig index ae9a5227c9..223f93d1ad 100644 --- a/std/debug.zig +++ b/std/debug.zig @@ -2283,13 +2283,11 @@ var global_allocator_mem: [100 * 1024]u8 = undefined; /// TODO multithreaded awareness var debug_info_allocator: ?*mem.Allocator = null; -var debug_info_direct_allocator: std.heap.DirectAllocator = undefined; var debug_info_arena_allocator: std.heap.ArenaAllocator = undefined; fn getDebugInfoAllocator() *mem.Allocator { if (debug_info_allocator) |a| return a; - debug_info_direct_allocator = std.heap.DirectAllocator.init(); - debug_info_arena_allocator = std.heap.ArenaAllocator.init(&debug_info_direct_allocator.allocator); + debug_info_arena_allocator = std.heap.ArenaAllocator.init(std.heap.direct_allocator); debug_info_allocator = &debug_info_arena_allocator.allocator; return &debug_info_arena_allocator.allocator; } -- cgit v1.2.3