From ec06c26b14101f1fa244c9a70883a5f4d2ff1852 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Wed, 16 Apr 2014 13:27:31 +0000 Subject: try to use main sigaltstack code for mac --- gcl/h/386-macosx.h | 25 ++++++++++++++----------- gcl/o/alloc.c | 3 +++ gcl/o/main.c | 9 --------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/gcl/h/386-macosx.h b/gcl/h/386-macosx.h index 79cb0114..37eff0d9 100644 --- a/gcl/h/386-macosx.h +++ b/gcl/h/386-macosx.h @@ -114,17 +114,20 @@ extern int seek_to_end_ofile (FILE *); /* Modified according to Camm's instructions on April 15, 2004. */ #define HAVE_SIGPROCMASK /* #define SIG_STACK_SIZE (SIGSTKSZ/sizeof(double)) */ -#define SETUP_SIG_STACK \ -{ \ -static stack_t estack; \ -static double estack_buf [SIG_STACK_SIZE]; \ -bzero(estack_buf, sizeof(estack_buf)); \ -estack.ss_sp = (char *) &estack_buf[SIG_STACK_SIZE-1]; \ -estack.ss_flags = 0; \ -estack.ss_size = SIGSTKSZ; \ -if (sigaltstack(&estack, 0) < 0) \ - perror("sigaltstack"); \ -} +/* #define SIG_STACK_SIZE 1000 */ +/* #define SETUP_SIG_STACK \ */ +/* { \ */ +/* static stack_t estack; \ */ +/* static double estack_buf [SIG_STACK_SIZE]; \ */ +/* bzero(estack_buf, sizeof(estack_buf)); \ */ +/* estack.ss_sp = (char *) &estack_buf[SIG_STACK_SIZE-1]; \ */ +/* estack.ss_flags = 0; \ */ +/* estack.ss_size = SIGSTKSZ; \ */ +/* if (sigaltstack(&estack, 0) < 0) \ */ +/* perror("sigaltstack"); \ */ +/* } */ + +#define ADVANCE_ESTACK_POINTER /* until the sgc/save problem can be fixed. 20050114 CM*/ /* #define SGC */ diff --git a/gcl/o/alloc.c b/gcl/o/alloc.c index daf3aedf..72357656 100644 --- a/gcl/o/alloc.c +++ b/gcl/o/alloc.c @@ -1048,6 +1048,9 @@ gcl_init_alloc(void *cs_start) { bzero(estack_buf,sizeof(estack_buf)); estack.ss_sp = estack_buf; +#ifdef ADVANCE_ESTACK_POINTER + estack.ss_sp+=sizeof(estack_buf)-sizeof(*estack_buf); +#endif estack.ss_flags = 0; estack.ss_size = sizeof(estack_buf); massert(sigaltstack(&estack, 0)>=0); diff --git a/gcl/o/main.c b/gcl/o/main.c index f7b8a02d..ac49d7c7 100755 --- a/gcl/o/main.c +++ b/gcl/o/main.c @@ -101,15 +101,6 @@ int sgc_enabled; #endif void install_segmentation_catcher(void); -#ifndef SIG_STACK_SIZE -#define SIG_STACK_SIZE 1000 -#endif -#ifndef SETUP_SIG_STACK -#if defined(HAVE_SIGACTION) || defined(HAVE_SIGVEC) - struct sigstack estack; -#endif -#endif - int cstack_dir=0; static int -- cgit v1.2.3