summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamm Maguire <camm@debian.org>2014-04-16 13:27:31 +0000
committerCamm Maguire <camm@debian.org>2014-04-21 15:02:03 +0000
commitec06c26b14101f1fa244c9a70883a5f4d2ff1852 (patch)
tree99e0b0163182bc7da2af72834c3b1a56c8c0408d
parent329e5c7ce82e7e047ca25922260219821cfb16ec (diff)
downloadgcl-ec06c26b14101f1fa244c9a70883a5f4d2ff1852.tar.gz
try to use main sigaltstack code for mac
-rw-r--r--gcl/h/386-macosx.h25
-rw-r--r--gcl/o/alloc.c3
-rwxr-xr-xgcl/o/main.c9
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