From f8a850b250655bd26f5da4cfe7299b4a32be28fa Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Fri, 26 Jul 2013 21:17:24 +0400 Subject: runtime: refactor mallocgc Make it accept type, combine flags. Several reasons for the change: 1. mallocgc and settype must be atomic wrt GC 2. settype is called from only one place now 3. it will help performance (eventually settype functionality must be combined with markallocated) 4. flags are easier to read now (no mallocgc(sz, 0, 1, 0) anymore) R=golang-dev, iant, nightlyone, rsc, dave, khr, bradfitz, r CC=golang-dev https://golang.org/cl/10136043 --- src/pkg/runtime/mfinal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pkg/runtime/mfinal.c') diff --git a/src/pkg/runtime/mfinal.c b/src/pkg/runtime/mfinal.c index 2f5e4277dd..1216fd4157 100644 --- a/src/pkg/runtime/mfinal.c +++ b/src/pkg/runtime/mfinal.c @@ -117,8 +117,8 @@ resizefintab(Fintab *tab) newtab.max *= 3; } - newtab.key = runtime·mallocgc(newtab.max*sizeof newtab.key[0], FlagNoPointers, 0, 1); - newtab.val = runtime·mallocgc(newtab.max*sizeof newtab.val[0], 0, 0, 1); + newtab.key = runtime·mallocgc(newtab.max*sizeof newtab.key[0], 0, FlagNoInvokeGC|FlagNoPointers); + newtab.val = runtime·mallocgc(newtab.max*sizeof newtab.val[0], 0, FlagNoInvokeGC); for(i=0; imax; i++) { k = tab->key[i]; -- cgit v1.3