diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-12-19 18:00:35 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-12-19 18:00:35 +0000 |
commit | 0d3dd8fb65050363f1f82b5f048799fd9a0a0f5a (patch) | |
tree | 2ebab7c43a3260f883a2cf83ca162d10a8850870 /libgo/runtime/runtime_c.c | |
parent | 4daecdb62396a1571f3cba861a0068ab539f8e28 (diff) | |
download | gcc-0d3dd8fb65050363f1f82b5f048799fd9a0a0f5a.zip gcc-0d3dd8fb65050363f1f82b5f048799fd9a0a0f5a.tar.gz gcc-0d3dd8fb65050363f1f82b5f048799fd9a0a0f5a.tar.bz2 |
runtime: copy cgo support from Go 1.7 runtime
Remove support for _cgo_allocate. It was removed from the gc
toolchain in Go 1.5, so it is unlikely that anybody is trying to use it.
Reviewed-on: https://go-review.googlesource.com/34557
From-SVN: r243805
Diffstat (limited to 'libgo/runtime/runtime_c.c')
-rw-r--r-- | libgo/runtime/runtime_c.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/libgo/runtime/runtime_c.c b/libgo/runtime/runtime_c.c index 3387401..ad167877 100644 --- a/libgo/runtime/runtime_c.c +++ b/libgo/runtime/runtime_c.c @@ -99,43 +99,12 @@ runtime_cputicks(void) void runtime_mpreinit(M *mp) { - int32 stacksize = 32 * 1024; // OS X wants >=8K, Linux >=2K - -#ifdef SIGSTKSZ - if(stacksize < SIGSTKSZ) - stacksize = SIGSTKSZ; -#endif - - mp->gsignal = runtime_malg(stacksize, (byte**)&mp->gsignalstack, &mp->gsignalstacksize); + mp->gsignal = runtime_malg(true, true, (byte**)&mp->gsignalstack, &mp->gsignalstacksize); mp->gsignal->m = mp; } -// Called to initialize a new m (including the bootstrap m). -// Called on the new thread, can not allocate memory. -void -runtime_minit(void) -{ - M* m; - sigset_t sigs; - - // Initialize signal handling. - m = runtime_m(); - runtime_signalstack(m->gsignalstack, m->gsignalstacksize); - if (sigemptyset(&sigs) != 0) - runtime_throw("sigemptyset"); - pthread_sigmask(SIG_SETMASK, &sigs, nil); -} - -// Called from dropm to undo the effect of an minit. -void -runtime_unminit(void) -{ - runtime_signalstack(nil, 0); -} - - void -runtime_signalstack(byte *p, int32 n) +runtime_signalstack(byte *p, uintptr n) { stack_t st; |