diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c index b7ebaa63a5b..d5a6d9167ea 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4998,8 +4998,9 @@ mark_stack (char const *bottom, char const *end) | |||
| 4998 | #endif | 4998 | #endif |
| 4999 | } | 4999 | } |
| 5000 | 5000 | ||
| 5001 | /* This is a trampoline function that flushes registers to the stack, | 5001 | /* flush_stack_call_func is the trampoline function that flushes |
| 5002 | and then calls FUNC. ARG is passed through to FUNC verbatim. | 5002 | registers to the stack, and then calls FUNC. ARG is passed through |
| 5003 | to FUNC verbatim. | ||
| 5003 | 5004 | ||
| 5004 | This function must be called whenever Emacs is about to release the | 5005 | This function must be called whenever Emacs is about to release the |
| 5005 | global interpreter lock. This lets the garbage collector easily | 5006 | global interpreter lock. This lets the garbage collector easily |
| @@ -5007,7 +5008,20 @@ mark_stack (char const *bottom, char const *end) | |||
| 5007 | Lisp. | 5008 | Lisp. |
| 5008 | 5009 | ||
| 5009 | It is invalid to run any Lisp code or to allocate any GC memory | 5010 | It is invalid to run any Lisp code or to allocate any GC memory |
| 5010 | from FUNC. */ | 5011 | from FUNC. |
| 5012 | |||
| 5013 | Note: all register spilling is done in flush_stack_call_func before | ||
| 5014 | flush_stack_call_func1 is activated. | ||
| 5015 | |||
| 5016 | flush_stack_call_func1 is responsible for identifying the stack | ||
| 5017 | address range to be scanned. It *must* be carefully kept as | ||
| 5018 | noinline to make sure that registers has been spilled before it is | ||
| 5019 | called, otherwise given __builtin_frame_address (0) typically | ||
| 5020 | returns the frame pointer (base pointer) and not the stack pointer | ||
| 5021 | [1] GC will miss to scan callee-saved registers content | ||
| 5022 | (Bug#41357). | ||
| 5023 | |||
| 5024 | [1] <https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html>. */ | ||
| 5011 | 5025 | ||
| 5012 | NO_INLINE void | 5026 | NO_INLINE void |
| 5013 | flush_stack_call_func1 (void (*func) (void *arg), void *arg) | 5027 | flush_stack_call_func1 (void (*func) (void *arg), void *arg) |