summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/freebsd/mem.c
blob: 52e351a7d7ee9a8b07e48ca6abfd133d200f19cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "runtime.h"
#include "defs.h"
#include "os.h"
#include "malloc.h"

void*
SysAlloc(uintptr n)
{
	mstats.sys += n;
	return runtime_mmap(nil, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_PRIVATE, -1, 0);
}

void
SysUnused(void *v, uintptr n)
{
	USED(v);
	USED(n);
	// TODO(rsc): call madvise MADV_DONTNEED
}

void
SysFree(void *v, uintptr n)
{
	USED(v);
	USED(n);
	// TODO(rsc): call munmap
}