aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/debug')
-rw-r--r--lib/std/debug/MemoryAccessor.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/std/debug/MemoryAccessor.zig b/lib/std/debug/MemoryAccessor.zig
index 9f112262be..5f57ad5853 100644
--- a/lib/std/debug/MemoryAccessor.zig
+++ b/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) {