aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-09 01:08:34 -0400
committerRuss Cox <rsc@golang.org>2014-09-09 01:08:34 -0400
commitbffb0590c1e1125830377165eb98bf1b73bb016e (patch)
treeb8a7f8e9ef3b9bfdb53c2c7aea4ca6d95193d46b /src/runtime/malloc.c
parent0f99a91bb56dd01dfd4e5ce4344e6006e3463ade (diff)
downloadgo-bffb0590c1e1125830377165eb98bf1b73bb016e.tar.xz
runtime: merge mallocgc, gomallocgc
I assumed they were the same when I wrote cgocallback.go earlier today. Merge them to eliminate confusion. I can't tell what gomallocgc did before with a nil type but without FlagNoScan. I created a call like that in cgocallback.go this morning, translating from a C file. It was supposed to do what the C version did, namely treat the block conservatively. Now it will. LGTM=khr R=khr CC=golang-codereviews https://golang.org/cl/141810043
Diffstat (limited to 'src/runtime/malloc.c')
-rw-r--r--src/runtime/malloc.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/runtime/malloc.c b/src/runtime/malloc.c
index 752ff60f37..b56f42531e 100644
--- a/src/runtime/malloc.c
+++ b/src/runtime/malloc.c
@@ -23,23 +23,8 @@ MStats runtime·memstats;
Type* runtime·conservative;
-void runtime·cmallocgc(uintptr size, Type *typ, uint32 flag, void **ret);
void runtime·gc_notype_ptr(Eface*);
-void*
-runtime·mallocgc(uintptr size, Type *typ, uint32 flag)
-{
- void *ret;
-
- // Call into the Go version of mallocgc.
- // TODO: maybe someday we can get rid of this. It is
- // probably the only location where we run Go code on the M stack.
- if((flag&FlagNoScan) == 0 && typ == nil)
- typ = runtime·conservative;
- runtime·cmallocgc(size, typ, flag, &ret);
- return ret;
-}
-
int32
runtime·mlookup(void *v, byte **base, uintptr *size, MSpan **sp)
{