authorgravatar for tgschultz@gmail.comtgschultz <tgschultz@gmail.com> 2018-12-20 11:51:37-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-20 14:49:34-05:00
logf35ba34a884eb8253c2ddd584605191e1b977595
tree455a94a919608639c2535fec4fa56b612a567815
parent8cf3543c800e8a04afd99951616c70fd55651e39

Removed allocator from Linux version DynLib. Added dynamic_library.zig to std test list.


2 files changed, 3 insertions(+), 4 deletions(-)

std/dynamic_library.zig+1-3
......@@ -19,7 +19,6 @@ pub const DynLib = switch (builtin.os) {
1919};
2020
2121pub const LinuxDynLib = struct {
22 allocator: *mem.Allocator,
2322 elf_lib: ElfLib,
2423 fd: i32,
2524 map_addr: usize,
......@@ -27,7 +26,7 @@ pub const LinuxDynLib = struct {
2726
2827 /// Trusts the file
2928 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);
3130 errdefer std.os.close(fd);
3231
3332 const size = @intCast(usize, (try std.os.posixFStat(fd)).size);
......@@ -45,7 +44,6 @@ pub const LinuxDynLib = struct {
4544 const bytes = @intToPtr([*]align(std.os.page_size) u8, addr)[0..size];
4645
4746 return DynLib{
48 .allocator = allocator,
4947 .elf_lib = try ElfLib.init(bytes),
5048 .fd = fd,
5149 .map_addr = addr,
std/index.zig+2-1
......@@ -57,7 +57,8 @@ test "std" {
5757 _ = @import("mutex.zig");
5858 _ = @import("segmented_list.zig");
5959 _ = @import("spinlock.zig");
60
60
61 _ = @import("dynamic_library.zig");
6162 _ = @import("base64.zig");
6263 _ = @import("build.zig");
6364 _ = @import("c/index.zig");