[Git][cmucl/cmucl][issue-122-dynamically-allocate-altstack] Only allocate altstack once.

Raymond Toy (@rtoy) gitlab at common-lisp.net
Sun Jan 30 23:40:49 UTC 2022



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/e6dd7ca518562373e4a1bf673bfa673d46fa2dd6

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/e6dd7ca518562373e4a1bf673bfa673d46fa2dd6
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20220130/b9f2c986/attachment.html>


More information about the cmucl-cvs mailing list