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