aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/malloc.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-01-09 19:37:19 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-01-09 19:37:19 +0000
commit2193ad7fbf3e917a0ef5a2b48e13f84da1be44f1 (patch)
tree979f6f9c20889cbbef8a131ed63b6e7f4b7216f6 /libgo/runtime/malloc.h
parentd1261ac6eb62f0c589ef314c61884ab445e5552b (diff)
downloadgcc-2193ad7fbf3e917a0ef5a2b48e13f84da1be44f1.zip
gcc-2193ad7fbf3e917a0ef5a2b48e13f84da1be44f1.tar.gz
gcc-2193ad7fbf3e917a0ef5a2b48e13f84da1be44f1.tar.bz2
runtime: copy more of scheduler from Go 1.7 runtime
This started by moving procresize from C to Go so that we can pass the right type to the memory allocator when allocating a p, which forced the gomaxprocs variable to move from C to Go, and everything else followed from that. Reviewed-on: https://go-review.googlesource.com/34916 From-SVN: r244236
Diffstat (limited to 'libgo/runtime/malloc.h')
-rw-r--r--libgo/runtime/malloc.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/libgo/runtime/malloc.h b/libgo/runtime/malloc.h
index f13d5b3..00e4166 100644
--- a/libgo/runtime/malloc.h
+++ b/libgo/runtime/malloc.h
@@ -132,12 +132,6 @@ enum
#else
MHeapMap_Bits = 32 - PageShift,
#endif
-
- // Max number of threads to run garbage collection.
- // 2, 3, and 4 are all plausible maximums depending
- // on the hardware details of the machine. The garbage
- // collector scales well to 8 cpus.
- MaxGcproc = 8,
};
// Maximum memory allocation size, a hint for callers.
@@ -186,7 +180,8 @@ enum
void* runtime_SysAlloc(uintptr nbytes, uint64 *stat)
__asm__ (GOSYM_PREFIX "runtime.sysAlloc");
-void runtime_SysFree(void *v, uintptr nbytes, uint64 *stat);
+void runtime_SysFree(void *v, uintptr nbytes, uint64 *stat)
+ __asm__ (GOSYM_PREFIX "runtime.sysFree");
void runtime_SysUnused(void *v, uintptr nbytes);
void runtime_SysUsed(void *v, uintptr nbytes);
void runtime_SysMap(void *v, uintptr nbytes, bool reserved, uint64 *stat);
@@ -467,11 +462,15 @@ void runtime_MProf_GC(void)
__asm__ (GOSYM_PREFIX "runtime.mProf_GC");
void runtime_iterate_memprof(FuncVal* callback)
__asm__ (GOSYM_PREFIX "runtime.iterate_memprof");
-int32 runtime_gcprocs(void);
-void runtime_helpgc(int32 nproc);
-void runtime_gchelper(void);
+int32 runtime_gcprocs(void)
+ __asm__ (GOSYM_PREFIX "runtime.gcprocs");
+void runtime_helpgc(int32 nproc)
+ __asm__ (GOSYM_PREFIX "runtime.helpgc");
+void runtime_gchelper(void)
+ __asm__ (GOSYM_PREFIX "runtime.gchelper");
void runtime_createfing(void);
-G* runtime_wakefing(void);
+G* runtime_wakefing(void)
+ __asm__ (GOSYM_PREFIX "runtime.wakefing");
extern bool runtime_fingwait;
extern bool runtime_fingwake;