aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/mem_gccgo.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/mem_gccgo.go')
-rw-r--r--libgo/go/runtime/mem_gccgo.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/libgo/go/runtime/mem_gccgo.go b/libgo/go/runtime/mem_gccgo.go
index ba38eba..fa3389d 100644
--- a/libgo/go/runtime/mem_gccgo.go
+++ b/libgo/go/runtime/mem_gccgo.go
@@ -48,7 +48,7 @@ func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (u
// Don't split the stack as this method may be invoked without a valid G, which
// prevents us from allocating more stack.
//go:nosplit
-func sysAlloc(n uintptr, sysStat *uint64) unsafe.Pointer {
+func sysAlloc(n uintptr, sysStat *sysMemStat) unsafe.Pointer {
p, err := mmap(nil, n, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, mmapFD, 0)
if err != 0 {
if err == _EACCES {
@@ -61,7 +61,7 @@ func sysAlloc(n uintptr, sysStat *uint64) unsafe.Pointer {
}
return nil
}
- mSysStatInc(sysStat, n)
+ sysStat.add(int64(n))
return p
}
@@ -166,8 +166,8 @@ func sysHugePage(v unsafe.Pointer, n uintptr) {
// Don't split the stack as this function may be invoked without a valid G,
// which prevents us from allocating more stack.
//go:nosplit
-func sysFree(v unsafe.Pointer, n uintptr, sysStat *uint64) {
- mSysStatDec(sysStat, n)
+func sysFree(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
+ sysStat.add(-int64(n))
munmap(v, n)
}
@@ -183,8 +183,8 @@ func sysReserve(v unsafe.Pointer, n uintptr) unsafe.Pointer {
return p
}
-func sysMap(v unsafe.Pointer, n uintptr, sysStat *uint64) {
- mSysStatInc(sysStat, n)
+func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
+ sysStat.add(int64(n))
if GOOS == "aix" {
// AIX does not allow mapping a range that is already mapped.