Raymond Toy pushed to branch issue-122-dynamically-allocate-altstack at cmucl / cmucl
Commits:
e6dd7ca5 by Raymond Toy at 2022-01-30T15:40:37-08:00
Only allocate altstack once.
Initialize altstack to NULL, so that we can tell if we need to
allocate space for it.
- - - - -
1 changed file:
- src/lisp/interrupt.c
Changes:
=====================================
src/lisp/interrupt.c
=====================================
@@ -406,7 +406,7 @@ interrupt_maybe_gc(HANDLER_ARGS)
\****************************************************************/
#if defined(__linux__)
-char* altstack;
+char* altstack = NULL;
#else
char altstack[SIGNAL_STACK_SIZE];
#endif
@@ -436,7 +436,14 @@ interrupt_install_low_level_handler(int signal, void handler(HANDLER_ARGS))
sigstack.ss_sp = (void *) SIGNAL_STACK_START;
#else
#if defined(__linux__)
- altstack = malloc(SIGSTKSZ);
+ /*
+ * For gcc 11.2 (clang 13.0), we need to allocate altstack
+ * dynamically. Do this here, but only if we haven't already
+ * allocated space.
+ */
+ if (altstack == NULL) {
+ altstack = malloc(SIGSTKSZ);
+ }
#endif
sigstack.ss_sp = (void *) altstack;
#endif
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/e6dd7ca518562373e4a1bf6…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/e6dd7ca518562373e4a1bf6…
You're receiving this email because of your account on gitlab.common-lisp.net.