From cd2f8356ce5515c87710bc7ababfee8fdbdee9c3 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Thu, 7 Aug 2014 13:04:04 +0400 Subject: runtime: remove mal/malloc/FlagNoGC/FlagNoInvokeGC FlagNoGC is unused now. FlagNoInvokeGC is unneeded as we don't invoke GC on g0 and when holding locks anyway. mal/malloc have very few uses and you never remember the exact set of flags they use and the difference between them. Moreover, eventually we need to give exact types to all allocations, something what mal/malloc do not support. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rsc https://golang.org/cl/117580043 --- src/pkg/runtime/proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pkg/runtime/proc.c') diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 26e687e3b4..137f49f5f0 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -183,7 +183,7 @@ runtime·schedinit(void) n = MaxGomaxprocs; procs = n; } - runtime·allp = runtime·malloc((MaxGomaxprocs+1)*sizeof(runtime·allp[0])); + runtime·allp = runtime·mallocgc((MaxGomaxprocs+1)*sizeof(runtime·allp[0]), nil, 0); procresize(procs); runtime·copystack = runtime·precisestack; @@ -1926,7 +1926,7 @@ allgadd(G *gp) cap = 4096/sizeof(new[0]); if(cap < 2*allgcap) cap = 2*allgcap; - new = runtime·malloc(cap*sizeof(new[0])); + new = runtime·mallocgc(cap*sizeof(new[0]), nil, 0); if(new == nil) runtime·throw("runtime: cannot allocate memory"); if(runtime·allg != nil) @@ -2396,7 +2396,7 @@ procresize(int32 new) for(i = 0; i < new; i++) { p = runtime·allp[i]; if(p == nil) { - p = (P*)runtime·mallocgc(sizeof(*p), 0, FlagNoInvokeGC); + p = (P*)runtime·mallocgc(sizeof(*p), 0, 0); p->id = i; p->status = Pgcstop; runtime·atomicstorep(&runtime·allp[i], p); -- cgit v1.3