Commit c44be99f1a
Changed files (2)
lib
std
lib/std/debug/MemoryAccessor.zig
@@ -25,6 +25,17 @@ pub const init: MemoryAccessor = .{
},
};
+pub fn deinit(ma: *MemoryAccessor) void {
+ switch (native_os) {
+ .linux => switch (ma.mem.handle) {
+ -2, -1 => {},
+ else => ma.mem.close(),
+ },
+ else => {},
+ }
+ ma.* = undefined;
+}
+
fn read(ma: *MemoryAccessor, address: usize, buf: []u8) bool {
switch (native_os) {
.linux => while (true) switch (ma.mem.handle) {
lib/std/debug.zig
@@ -775,6 +775,7 @@ pub const StackIterator = struct {
}
pub fn deinit(it: *StackIterator) void {
+ it.ma.deinit();
if (have_ucontext and it.unwind_state != null) it.unwind_state.?.dwarf_context.deinit();
}