diff options
| author | tgschultz <tgschultz@gmail.com> | 2018-12-20 11:51:37 -0600 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2018-12-20 14:49:34 -0500 |
| commit | f35ba34a884eb8253c2ddd584605191e1b977595 (patch) | |
| tree | 455a94a919608639c2535fec4fa56b612a567815 /std | |
| parent | 8cf3543c800e8a04afd99951616c70fd55651e39 (diff) | |
| download | zig-f35ba34a884eb8253c2ddd584605191e1b977595.tar.gz zig-f35ba34a884eb8253c2ddd584605191e1b977595.zip | |
Removed allocator from Linux version DynLib. Added dynamic_library.zig to std test list.
Diffstat (limited to 'std')
| -rw-r--r-- | std/dynamic_library.zig | 4 | ||||
| -rw-r--r-- | std/index.zig | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/std/dynamic_library.zig b/std/dynamic_library.zig index 49f217bc8e..4d19951318 100644 --- a/std/dynamic_library.zig +++ b/std/dynamic_library.zig @@ -19,7 +19,6 @@ pub const DynLib = switch (builtin.os) { }; pub const LinuxDynLib = struct { - allocator: *mem.Allocator, elf_lib: ElfLib, fd: i32, map_addr: usize, @@ -27,7 +26,7 @@ pub const LinuxDynLib = struct { /// Trusts the file pub fn open(allocator: *mem.Allocator, path: []const u8) !DynLib { - const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC); + const fd = try std.os.posixOpen(path, 0, linux.O_RDONLY | linux.O_CLOEXEC); errdefer std.os.close(fd); const size = @intCast(usize, (try std.os.posixFStat(fd)).size); @@ -45,7 +44,6 @@ pub const LinuxDynLib = struct { const bytes = @intToPtr([*]align(std.os.page_size) u8, addr)[0..size]; return DynLib{ - .allocator = allocator, .elf_lib = try ElfLib.init(bytes), .fd = fd, .map_addr = addr, diff --git a/std/index.zig b/std/index.zig index 55ad016bb1..33eec14b0e 100644 --- a/std/index.zig +++ b/std/index.zig @@ -57,7 +57,8 @@ test "std" { _ = @import("mutex.zig"); _ = @import("segmented_list.zig"); _ = @import("spinlock.zig"); - + + _ = @import("dynamic_library.zig"); _ = @import("base64.zig"); _ = @import("build.zig"); _ = @import("c/index.zig"); |
