summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.cgo
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-04-09 15:30:40 -0700
committerRuss Cox <rsc@golang.org>2010-04-09 15:30:40 -0700
commit79da15518c65196d0a6eb86d682c74161f6e2ef4 (patch)
tree45108c80c561d126a26fc4ddcd55e275f4e8d8d4 /src/pkg/runtime/malloc.cgo
parentd13ec30e1e389fcd90e9d3be49765f49bf791f93 (diff)
downloadgolang-79da15518c65196d0a6eb86d682c74161f6e2ef4.tar.gz
runtime: delete malx, skip_depth argument to malloc
remove internal functions from traces in gopprof instead. R=r CC=golang-dev http://codereview.appspot.com/855046
Diffstat (limited to 'src/pkg/runtime/malloc.cgo')
-rw-r--r--src/pkg/runtime/malloc.cgo16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pkg/runtime/malloc.cgo b/src/pkg/runtime/malloc.cgo
index 2e7818a39..e6b965444 100644
--- a/src/pkg/runtime/malloc.cgo
+++ b/src/pkg/runtime/malloc.cgo
@@ -36,7 +36,7 @@ fastrand1(void)
// Small objects are allocated from the per-thread cache's free lists.
// Large objects (> 32 kB) are allocated straight from the heap.
void*
-mallocgc(uintptr size, uint32 refflag, int32 dogc, int32 zeroed, int32 skip_depth)
+mallocgc(uintptr size, uint32 refflag, int32 dogc, int32 zeroed)
{
int32 sizeclass, rate;
MCache *c;
@@ -105,7 +105,7 @@ mallocgc(uintptr size, uint32 refflag, int32 dogc, int32 zeroed, int32 skip_dept
m->mcache->next_sample = fastrand1() % (2*rate);
profile:
*ref |= RefProfiled;
- MProf_Malloc(skip_depth+1, v, size);
+ MProf_Malloc(v, size);
}
}
@@ -117,7 +117,7 @@ mallocgc(uintptr size, uint32 refflag, int32 dogc, int32 zeroed, int32 skip_dept
void*
malloc(uintptr size)
{
- return mallocgc(size, 0, 0, 1, 1);
+ return mallocgc(size, 0, 0, 1);
}
// Free the object whose base pointer is v.
@@ -258,13 +258,7 @@ mallocinit(void)
void*
mal(uintptr n)
{
- return mallocgc(n, 0, 1, 1, 2);
-}
-
-void*
-malx(uintptr n, int32 skip_delta)
-{
- return mallocgc(n, 0, 1, 1, 2+skip_delta);
+ return mallocgc(n, 0, 1, 1);
}
// Stack allocator uses malloc/free most of the time,
@@ -299,7 +293,7 @@ stackalloc(uint32 n)
unlock(&stacks);
return v;
}
- v = mallocgc(n, RefNoProfiling, 0, 0, 0);
+ v = mallocgc(n, RefNoProfiling, 0, 0);
if(!mlookup(v, nil, nil, nil, &ref))
throw("stackalloc mlookup");
*ref = RefStack;