Commit 3b089179 authored by Joel Sing's avatar Joel Sing Committed by Ian Lance Taylor

runtime: unbreak build on dragonfly

Update dragonfly memory functions to work with new memory statistics.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/13615043
parent 5f75314e
......@@ -14,14 +14,14 @@ enum
};
void*
runtime·SysAlloc(uintptr n)
runtime·SysAlloc(uintptr n, uint64 *stat)
{
void *v;
mstats.sys += n;
v = runtime·mmap(nil, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
if(v < (void*)4096)
return nil;
runtime·xadd64(stat, n);
return v;
}
......@@ -39,9 +39,9 @@ runtime·SysUsed(void *v, uintptr n)
}
void
runtime·SysFree(void *v, uintptr n)
runtime·SysFree(void *v, uintptr n, uint64 *stat)
{
mstats.sys -= n;
runtime·xadd64(stat, -(uint64)n);
runtime·munmap(v, n);
}
......@@ -63,11 +63,11 @@ runtime·SysReserve(void *v, uintptr n)
}
void
runtime·SysMap(void *v, uintptr n)
runtime·SysMap(void *v, uintptr n, uint64 *stat)
{
void *p;
mstats.sys += n;
runtime·xadd64(stat, n);
// On 64-bit, we don't actually have v reserved, so tread carefully.
if(sizeof(void*) == 8) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment