aboutsummaryrefslogtreecommitdiff
path: root/std/heap.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/heap.zig')
-rw-r--r--std/heap.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/heap.zig b/std/heap.zig
index 9dbae4b8e0..5c31d412cf 100644
--- a/std/heap.zig
+++ b/std/heap.zig
@@ -70,7 +70,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.freebsd => {
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,7 +121,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.freebsd => {
if (new_size <= old_mem.len) {
const base_addr = @ptrToInt(old_mem.ptr);
const old_addr_end = base_addr + old_mem.len;
@@ -166,7 +166,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.freebsd => {
_ = os.posix.munmap(@ptrToInt(bytes.ptr), bytes.len);
},
Os.windows => {