Added stack trace leak reporting to the debug allocator, fixed remaining two memory leaks

This commit is contained in:
Alexandros Naskos
2020-07-02 19:13:10 +03:00
parent 21e18a1d01
commit 8c154c2a60
3 changed files with 53 additions and 3 deletions

View File

@@ -1070,6 +1070,7 @@ fn semanticTokensHandler(arena: *std.heap.ArenaAllocator, id: types.RequestId, r
const semantic_tokens = @import("semantic_tokens.zig");
const token_array = try semantic_tokens.writeAllSemanticTokens(arena, &document_store, handle);
defer allocator.free(token_array);
return try send(arena, types.Response{
.id = id,
@@ -1382,6 +1383,8 @@ pub fn main() anyerror!void {
defer if (debug_alloc) |dbg| {
std.debug.print("Finished cleanup, last allocation info.\n", .{});
std.debug.print("\n{}\n", .{dbg.info});
dbg.printRemainingStackTraces();
dbg.deinit();
};
// Init global vars