From: Joel Sing Date: Mon, 9 Sep 2013 15:48:06 +0000 (-0700) Subject: runtime: unbreak build on dragonfly X-Git-Tag: go1.2rc2~310 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3b089179c4779c09becd395634b0a31f376865f1;p=gostls13.git 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 --- diff --git a/src/pkg/runtime/mem_dragonfly.c b/src/pkg/runtime/mem_dragonfly.c index cc45cc96c1..025b62ea67 100644 --- a/src/pkg/runtime/mem_dragonfly.c +++ b/src/pkg/runtime/mem_dragonfly.c @@ -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) {