aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/pkg/runtime/cpuprof.goc2
-rw-r--r--src/pkg/runtime/heapdump.c2
-rw-r--r--src/pkg/runtime/malloc.c8
-rw-r--r--src/pkg/runtime/malloc.h14
-rw-r--r--src/pkg/runtime/mem_darwin.c2
-rw-r--r--src/pkg/runtime/mem_dragonfly.c2
-rw-r--r--src/pkg/runtime/mem_freebsd.c2
-rw-r--r--src/pkg/runtime/mem_linux.c2
-rw-r--r--src/pkg/runtime/mem_nacl.c6
-rw-r--r--src/pkg/runtime/mem_netbsd.c2
-rw-r--r--src/pkg/runtime/mem_openbsd.c2
-rw-r--r--src/pkg/runtime/mem_plan9.c4
-rw-r--r--src/pkg/runtime/mem_solaris.c2
-rw-r--r--src/pkg/runtime/mem_windows.c2
-rw-r--r--src/pkg/runtime/mheap.c2
-rw-r--r--src/pkg/runtime/mprof.goc2
-rw-r--r--src/pkg/runtime/stack.c2
17 files changed, 29 insertions, 29 deletions
diff --git a/src/pkg/runtime/cpuprof.goc b/src/pkg/runtime/cpuprof.goc
index 8ae06edcb1..0d6d078ffd 100644
--- a/src/pkg/runtime/cpuprof.goc
+++ b/src/pkg/runtime/cpuprof.goc
@@ -137,7 +137,7 @@ runtime·SetCPUProfileRate(intgo hz)
runtime·lock(&lk);
if(hz > 0) {
if(prof == nil) {
- prof = runtime·SysAlloc(sizeof *prof, &mstats.other_sys);
+ prof = runtime·sysAlloc(sizeof *prof, &mstats.other_sys);
if(prof == nil) {
runtime·printf("runtime: cpu profiling cannot allocate memory\n");
runtime·unlock(&lk);
diff --git a/src/pkg/runtime/heapdump.c b/src/pkg/runtime/heapdump.c
index fe67e15f35..29a9ae6476 100644
--- a/src/pkg/runtime/heapdump.c
+++ b/src/pkg/runtime/heapdump.c
@@ -825,7 +825,7 @@ makeheapobjbv(byte *p, uintptr size)
if(tmpbuf != nil)
runtime·SysFree(tmpbuf, tmpbufsize, &mstats.other_sys);
tmpbufsize = nptr*BitsPerPointer/8+1;
- tmpbuf = runtime·SysAlloc(tmpbufsize, &mstats.other_sys);
+ tmpbuf = runtime·sysAlloc(tmpbufsize, &mstats.other_sys);
if(tmpbuf == nil)
runtime·throw("heapdump: out of memory");
}
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");
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index 6cd72fb31f..6994557459 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -160,12 +160,12 @@ struct MLink
MLink *next;
};
-// SysAlloc obtains a large chunk of zeroed memory from the
+// sysAlloc obtains a large chunk of zeroed memory from the
// operating system, typically on the order of a hundred kilobytes
// or a megabyte.
-// NOTE: SysAlloc returns OS-aligned memory, but the heap allocator
+// NOTE: sysAlloc returns OS-aligned memory, but the heap allocator
// may use larger alignment, so the caller must be careful to realign the
-// memory obtained by SysAlloc.
+// memory obtained by sysAlloc.
//
// SysUnused notifies the operating system that the contents
// of the memory region are no longer needed and can be reused
@@ -187,16 +187,16 @@ struct MLink
// reserved, false if it has merely been checked.
// NOTE: SysReserve returns OS-aligned memory, but the heap allocator
// may use larger alignment, so the caller must be careful to realign the
-// memory obtained by SysAlloc.
+// memory obtained by sysAlloc.
//
// SysMap maps previously reserved address space for use.
// The reserved argument is true if the address space was really
// reserved, not merely checked.
//
-// SysFault marks a (already SysAlloc'd) region to fault
+// SysFault marks a (already sysAlloc'd) region to fault
// if accessed. Used only for debugging the runtime.
-void* runtime·SysAlloc(uintptr nbytes, uint64 *stat);
+void* runtime·sysAlloc(uintptr nbytes, uint64 *stat);
void runtime·SysFree(void *v, uintptr nbytes, uint64 *stat);
void runtime·SysUnused(void *v, uintptr nbytes);
void runtime·SysUsed(void *v, uintptr nbytes);
@@ -205,7 +205,7 @@ void* runtime·SysReserve(void *v, uintptr nbytes, bool *reserved);
void runtime·SysFault(void *v, uintptr nbytes);
// FixAlloc is a simple free-list allocator for fixed size objects.
-// Malloc uses a FixAlloc wrapped around SysAlloc to manages its
+// Malloc uses a FixAlloc wrapped around sysAlloc to manages its
// MCache and MSpan objects.
//
// Memory returned by FixAlloc_Alloc is not zeroed.
diff --git a/src/pkg/runtime/mem_darwin.c b/src/pkg/runtime/mem_darwin.c
index 878c4e1c55..ca0ac72de9 100644
--- a/src/pkg/runtime/mem_darwin.c
+++ b/src/pkg/runtime/mem_darwin.c
@@ -9,7 +9,7 @@
#include "malloc.h"
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
diff --git a/src/pkg/runtime/mem_dragonfly.c b/src/pkg/runtime/mem_dragonfly.c
index c270332cb9..55410cef64 100644
--- a/src/pkg/runtime/mem_dragonfly.c
+++ b/src/pkg/runtime/mem_dragonfly.c
@@ -14,7 +14,7 @@ enum
};
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
diff --git a/src/pkg/runtime/mem_freebsd.c b/src/pkg/runtime/mem_freebsd.c
index 586947a2dc..a033bfcdc0 100644
--- a/src/pkg/runtime/mem_freebsd.c
+++ b/src/pkg/runtime/mem_freebsd.c
@@ -14,7 +14,7 @@ enum
};
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
diff --git a/src/pkg/runtime/mem_linux.c b/src/pkg/runtime/mem_linux.c
index 635594c365..429f820f8b 100644
--- a/src/pkg/runtime/mem_linux.c
+++ b/src/pkg/runtime/mem_linux.c
@@ -58,7 +58,7 @@ mmap_fixed(byte *v, uintptr n, int32 prot, int32 flags, int32 fd, uint32 offset)
}
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *p;
diff --git a/src/pkg/runtime/mem_nacl.c b/src/pkg/runtime/mem_nacl.c
index e2bca40a49..5c5f806324 100644
--- a/src/pkg/runtime/mem_nacl.c
+++ b/src/pkg/runtime/mem_nacl.c
@@ -14,19 +14,19 @@ enum
};
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
v = runtime·mmap(nil, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
if(v < (void*)4096) {
if(Debug)
- runtime·printf("SysAlloc(%p): %p\n", n, v);
+ runtime·printf("sysAlloc(%p): %p\n", n, v);
return nil;
}
runtime·xadd64(stat, n);
if(Debug)
- runtime·printf("SysAlloc(%p) = %p\n", n, v);
+ runtime·printf("sysAlloc(%p) = %p\n", n, v);
return v;
}
diff --git a/src/pkg/runtime/mem_netbsd.c b/src/pkg/runtime/mem_netbsd.c
index 861ae90c7e..cf4b24f920 100644
--- a/src/pkg/runtime/mem_netbsd.c
+++ b/src/pkg/runtime/mem_netbsd.c
@@ -14,7 +14,7 @@ enum
};
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
diff --git a/src/pkg/runtime/mem_openbsd.c b/src/pkg/runtime/mem_openbsd.c
index 861ae90c7e..cf4b24f920 100644
--- a/src/pkg/runtime/mem_openbsd.c
+++ b/src/pkg/runtime/mem_openbsd.c
@@ -14,7 +14,7 @@ enum
};
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
diff --git a/src/pkg/runtime/mem_plan9.c b/src/pkg/runtime/mem_plan9.c
index 8d31bcfe2d..aec652995f 100644
--- a/src/pkg/runtime/mem_plan9.c
+++ b/src/pkg/runtime/mem_plan9.c
@@ -36,7 +36,7 @@ brk(uintptr nbytes)
}
void*
-runtime·SysAlloc(uintptr nbytes, uint64 *stat)
+runtime·sysAlloc(uintptr nbytes, uint64 *stat)
{
void *p;
@@ -53,7 +53,7 @@ runtime·SysFree(void *v, uintptr nbytes, uint64 *stat)
runtime·lock(&memlock);
// from tiny/mem.c
// Push pointer back if this is a free
- // of the most recent SysAlloc.
+ // of the most recent sysAlloc.
nbytes += (nbytes + Round) & ~Round;
if(bloc == (byte*)v+nbytes)
bloc -= nbytes;
diff --git a/src/pkg/runtime/mem_solaris.c b/src/pkg/runtime/mem_solaris.c
index 034222887b..87536f6837 100644
--- a/src/pkg/runtime/mem_solaris.c
+++ b/src/pkg/runtime/mem_solaris.c
@@ -14,7 +14,7 @@ enum
};
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
void *v;
diff --git a/src/pkg/runtime/mem_windows.c b/src/pkg/runtime/mem_windows.c
index 5eb43b2a93..cb1c9de907 100644
--- a/src/pkg/runtime/mem_windows.c
+++ b/src/pkg/runtime/mem_windows.c
@@ -26,7 +26,7 @@ extern void *runtime·VirtualFree;
extern void *runtime·VirtualProtect;
void*
-runtime·SysAlloc(uintptr n, uint64 *stat)
+runtime·sysAlloc(uintptr n, uint64 *stat)
{
runtime·xadd64(stat, n);
return runtime·stdcall4(runtime·VirtualAlloc, 0, n, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
diff --git a/src/pkg/runtime/mheap.c b/src/pkg/runtime/mheap.c
index 90acd55f9f..9b165d6cad 100644
--- a/src/pkg/runtime/mheap.c
+++ b/src/pkg/runtime/mheap.c
@@ -36,7 +36,7 @@ RecordSpan(void *vh, byte *p)
cap = 64*1024/sizeof(all[0]);
if(cap < h->nspancap*3/2)
cap = h->nspancap*3/2;
- all = (MSpan**)runtime·SysAlloc(cap*sizeof(all[0]), &mstats.other_sys);
+ all = (MSpan**)runtime·sysAlloc(cap*sizeof(all[0]), &mstats.other_sys);
if(all == nil)
runtime·throw("runtime: cannot allocate memory");
if(h->allspans) {
diff --git a/src/pkg/runtime/mprof.goc b/src/pkg/runtime/mprof.goc
index a340ebdafb..589863a156 100644
--- a/src/pkg/runtime/mprof.goc
+++ b/src/pkg/runtime/mprof.goc
@@ -38,7 +38,7 @@ stkbucket(int32 typ, uintptr size, uintptr *stk, int32 nstk, bool alloc)
Bucket *b;
if(buckhash == nil) {
- buckhash = runtime·SysAlloc(BuckHashSize*sizeof buckhash[0], &mstats.buckhash_sys);
+ buckhash = runtime·sysAlloc(BuckHashSize*sizeof buckhash[0], &mstats.buckhash_sys);
if(buckhash == nil)
runtime·throw("runtime: cannot allocate memory");
}
diff --git a/src/pkg/runtime/stack.c b/src/pkg/runtime/stack.c
index 96f1946db2..e499b1f8b6 100644
--- a/src/pkg/runtime/stack.c
+++ b/src/pkg/runtime/stack.c
@@ -206,7 +206,7 @@ runtime·stackalloc(G *gp, uint32 n)
gp->stacksize += n;
if(runtime·debug.efence || StackFromSystem) {
- v = runtime·SysAlloc(ROUND(n, PageSize), &mstats.stacks_sys);
+ v = runtime·sysAlloc(ROUND(n, PageSize), &mstats.stacks_sys);
if(v == nil)
runtime·throw("out of memory (stackalloc)");
return v;