aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-08-30 00:54:40 -0400
committerRuss Cox <rsc@golang.org>2014-08-30 00:54:40 -0400
commit0316dafda26619175f35e5e89f1920ebf37c85a3 (patch)
treed8472c76f06504fc2de4350569e5b5214bb817a0 /src/pkg/runtime/malloc.c
parentd4df63c3e8f37aa6ea033bae8937673460915279 (diff)
downloadgo-0316dafda26619175f35e5e89f1920ebf37c85a3.tar.xz
runtime: rename SysAlloc to sysAlloc for Go
Renaming the C SysAlloc will let Go define a prototype without exporting it. For use in cpuprof.goc's translation to Go. LGTM=mdempsky R=golang-codereviews, mdempsky CC=golang-codereviews, iant https://golang.org/cl/140060043
Diffstat (limited to 'src/pkg/runtime/malloc.c')
-rw-r--r--src/pkg/runtime/malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/runtime/malloc.c b/src/pkg/runtime/malloc.c
index 143d9e5e9e..8210081553 100644
--- a/src/pkg/runtime/malloc.c
+++ b/src/pkg/runtime/malloc.c
@@ -320,7 +320,7 @@ runtime·MHeap_SysAlloc(MHeap *h, uintptr n)
// try to get memory at a location chosen by the OS
// and hope that it is in the range we allocated bitmap for.
p_size = ROUND(n, PageSize) + PageSize;
- p = runtime·SysAlloc(p_size, &mstats.heap_sys);
+ p = runtime·sysAlloc(p_size, &mstats.heap_sys);
if(p == nil)
return nil;
@@ -361,7 +361,7 @@ enum
PersistentAllocMaxBlock = 64<<10, // VM reservation granularity is 64K on windows
};
-// Wrapper around SysAlloc that can allocate small chunks.
+// Wrapper around sysAlloc that can allocate small chunks.
// There is no associated free operation.
// Intended for things like function/type/debug-related persistent data.
// If align is 0, uses default align (currently 8).
@@ -378,11 +378,11 @@ runtime·persistentalloc(uintptr size, uintptr align, uint64 *stat)
} else
align = 8;
if(size >= PersistentAllocMaxBlock)
- return runtime·SysAlloc(size, stat);
+ return runtime·sysAlloc(size, stat);
runtime·lock(&persistent.lock);
persistent.pos = (byte*)ROUND((uintptr)persistent.pos, align);
if(persistent.pos + size > persistent.end) {
- persistent.pos = runtime·SysAlloc(PersistentAllocChunk, &mstats.other_sys);
+ persistent.pos = runtime·sysAlloc(PersistentAllocChunk, &mstats.other_sys);
if(persistent.pos == nil) {
runtime·unlock(&persistent.lock);
runtime·throw("runtime: cannot allocate memory");