diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-05-28 20:23:55 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-05-29 04:23:38 -0400 |
| commit | 0c16cd2d0ed78be2d160f9c865cd0a8703348232 (patch) | |
| tree | e7ff390d89611797776f2e67151c1157059d6147 /std/heap.zig | |
| parent | cdf30c31ea36365859dd81c207aede3c45c4e022 (diff) | |
| download | zig-0c16cd2d0ed78be2d160f9c865cd0a8703348232.tar.gz zig-0c16cd2d0ed78be2d160f9c865cd0a8703348232.zip | |
run zig fmt on the codebase
See #1003
Diffstat (limited to 'std/heap.zig')
| -rw-r--r-- | std/heap.zig | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/std/heap.zig b/std/heap.zig index 7b753524a6..8d4938a7c3 100644 --- a/std/heap.zig +++ b/std/heap.zig @@ -68,9 +68,7 @@ pub const DirectAllocator = struct { const self = @fieldParentPtr(DirectAllocator, "allocator", allocator); switch (builtin.os) { - Os.linux, - Os.macosx, - Os.ios => { + Os.linux, Os.macosx, Os.ios => { const p = os.posix; const alloc_size = if (alignment <= os.page_size) n else n + alignment; const addr = p.mmap(null, alloc_size, p.PROT_READ | p.PROT_WRITE, p.MAP_PRIVATE | p.MAP_ANONYMOUS, -1, 0); @@ -121,9 +119,7 @@ pub const DirectAllocator = struct { const self = @fieldParentPtr(DirectAllocator, "allocator", allocator); switch (builtin.os) { - Os.linux, - Os.macosx, - Os.ios => { + Os.linux, Os.macosx, Os.ios => { if (new_size <= old_mem.len) { const base_addr = @ptrToInt(old_mem.ptr); const old_addr_end = base_addr + old_mem.len; @@ -168,9 +164,7 @@ pub const DirectAllocator = struct { const self = @fieldParentPtr(DirectAllocator, "allocator", allocator); switch (builtin.os) { - Os.linux, - Os.macosx, - Os.ios => { + Os.linux, Os.macosx, Os.ios => { _ = os.posix.munmap(@ptrToInt(bytes.ptr), bytes.len); }, Os.windows => { @@ -430,7 +424,7 @@ fn testAllocator(allocator: &mem.Allocator) !void { } fn testAllocatorLargeAlignment(allocator: &mem.Allocator) mem.Allocator.Error!void { - //Maybe a platform's page_size is actually the same as or + //Maybe a platform's page_size is actually the same as or // very near usize? if (os.page_size << 2 > @maxValue(usize)) return; |
