| ... | ... | @@ -19,7 +19,6 @@ pub const DynLib = switch (builtin.os) { |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | pub const LinuxDynLib = struct { |
| 22 | | allocator: *mem.Allocator, |
| 23 | 22 | elf_lib: ElfLib, |
| 24 | 23 | fd: i32, |
| 25 | 24 | map_addr: usize, |
| ... | ... | @@ -27,7 +26,7 @@ pub const LinuxDynLib = struct { |
| 27 | 26 | |
| 28 | 27 | /// Trusts the file |
| 29 | 28 | pub fn open(allocator: *mem.Allocator, path: []const u8) !DynLib { |
| 30 | | const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC); |
| 29 | const fd = try std.os.posixOpen(path, 0, linux.O_RDONLY | linux.O_CLOEXEC); |
| 31 | 30 | errdefer std.os.close(fd); |
| 32 | 31 | |
| 33 | 32 | const size = @intCast(usize, (try std.os.posixFStat(fd)).size); |
| ... | ... | @@ -45,7 +44,6 @@ pub const LinuxDynLib = struct { |
| 45 | 44 | const bytes = @intToPtr([*]align(std.os.page_size) u8, addr)[0..size]; |
| 46 | 45 | |
| 47 | 46 | return DynLib{ |
| 48 | | .allocator = allocator, |
| 49 | 47 | .elf_lib = try ElfLib.init(bytes), |
| 50 | 48 | .fd = fd, |
| 51 | 49 | .map_addr = addr, |