diff options
| author | Paul Eggert | 2019-03-19 12:37:13 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-03-19 12:37:36 -0700 |
| commit | 53914a10558a0a579bb30d95da93d677901bc4a9 (patch) | |
| tree | 7fc6c0c091b7d380fbfc9b7411b3b646eed59fde /src/thread.h | |
| parent | 3ed1621d843e057ad879fbed3605d32f55a065b9 (diff) | |
| download | emacs-53914a10558a0a579bb30d95da93d677901bc4a9.tar.gz emacs-53914a10558a0a579bb30d95da93d677901bc4a9.zip | |
Use ‘const’ to clarify GC marking
Add ‘const’ to make the GC marking code a bit clearer.
This can also help the compiler in some cases, I think because
GCC can now determine more often that the value of a static C
variable can be cached when its address is now converted to
‘Lisp Object const *’ before escaping.
* src/alloc.c (staticvec, mark_maybe_objects, mark_memory)
(mark_stack, staticpro, mark_object_root_visitor)
(garbage_collect_1):
* src/pdumper.c (dump_ptr_referrer, dump_emacs_reloc_to_lv)
(dump_emacs_reloc_to_emacs_ptr_raw, dump_root_visitor):
* src/lisp.h (vcopy, struct gc_root_visitor):
* src/sysdep.c (stack_overflow):
* src/thread.c (mark_one_thread):
* src/thread.h (struct thread_state):
Use pointer-to-const instead of plain pointer in some
GC-related places where either will do.
Diffstat (limited to 'src/thread.h')
| -rw-r--r-- | src/thread.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/thread.h b/src/thread.h index e46545baf27..cb7e60f21f8 100644 --- a/src/thread.h +++ b/src/thread.h | |||
| @@ -65,7 +65,7 @@ struct thread_state | |||
| 65 | /* m_stack_bottom must be the first non-Lisp field. */ | 65 | /* m_stack_bottom must be the first non-Lisp field. */ |
| 66 | /* An address near the bottom of the stack. | 66 | /* An address near the bottom of the stack. |
| 67 | Tells GC how to save a copy of the stack. */ | 67 | Tells GC how to save a copy of the stack. */ |
| 68 | char *m_stack_bottom; | 68 | char const *m_stack_bottom; |
| 69 | #define stack_bottom (current_thread->m_stack_bottom) | 69 | #define stack_bottom (current_thread->m_stack_bottom) |
| 70 | 70 | ||
| 71 | /* The address of an object near the C stack top, used to determine | 71 | /* The address of an object near the C stack top, used to determine |
| @@ -75,7 +75,7 @@ struct thread_state | |||
| 75 | error in Emacs. If the C function F calls G which calls H which | 75 | error in Emacs. If the C function F calls G which calls H which |
| 76 | calls ... F, then at least one of the functions in the chain | 76 | calls ... F, then at least one of the functions in the chain |
| 77 | should set this to the address of a local variable. */ | 77 | should set this to the address of a local variable. */ |
| 78 | void *stack_top; | 78 | void const *stack_top; |
| 79 | 79 | ||
| 80 | struct catchtag *m_catchlist; | 80 | struct catchtag *m_catchlist; |
| 81 | #define catchlist (current_thread->m_catchlist) | 81 | #define catchlist (current_thread->m_catchlist) |