diff options
Diffstat (limited to 'src/pkg/runtime/mem_openbsd.c')
| -rw-r--r-- | src/pkg/runtime/mem_openbsd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/runtime/mem_openbsd.c b/src/pkg/runtime/mem_openbsd.c index 8a7ef17e84..91e36eb608 100644 --- a/src/pkg/runtime/mem_openbsd.c +++ b/src/pkg/runtime/mem_openbsd.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) { |
