| author | |
| committer | |
| log | 65d04cbeb42318c66313346bb88999aee17f856f |
| tree | cd779a01f3f78322392cce0039212d50a0bdddc3 |
| parent | 48de57d8248d9203b44d28d7749b5d7c1a00deba |
2 files changed, 2 insertions(+), 7 deletions(-)
std/dynamic_library.zig+1-6| ... | ... | @@ -11,14 +11,9 @@ pub const DynLib = struct { |
| 11 | 11 | map_addr: usize, |
| 12 | 12 | map_size: usize, |
| 13 | 13 | |
| 14 | /// Trusts the file | |
| 15 | pub fn findAndOpen(allocator: *mem.Allocator, name: []const u8) !DynLib { | |
| 16 | return open(allocator, name); | |
| 17 | } | |
| 18 | ||
| 19 | 14 | /// Trusts the file |
| 20 | 15 | pub fn open(allocator: *mem.Allocator, path: []const u8) !DynLib { |
| 21 | const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY); | |
| 16 | const fd = try std.os.posixOpen(allocator, path, 0, linux.O_RDONLY | linux.O_CLOEXEC); | |
| 22 | 17 | errdefer std.os.close(fd); |
| 23 | 18 | |
| 24 | 19 | const size = usize((try std.os.posixFStat(fd)).size); |
std/math/index.zig+1-1| ... | ... | @@ -538,7 +538,7 @@ test "math.cast" { |
| 538 | 538 | |
| 539 | 539 | pub const AlignCastError = error{UnalignedMemory}; |
| 540 | 540 | |
| 541 | /// Align cast a pointer but return an error if it's the wrong field | |
| 541 | /// Align cast a pointer but return an error if it's the wrong alignment | |
| 542 | 542 | pub fn alignCast(comptime alignment: u29, ptr: var) AlignCastError!@typeOf(@alignCast(alignment, ptr)) { |
| 543 | 543 | const addr = @ptrToInt(ptr); |
| 544 | 544 | if (addr % alignment != 0) { |