[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 68b6dad: Be more aggressive in marking objects during GC
From: |
Paul Eggert |
Subject: |
emacs-27 68b6dad: Be more aggressive in marking objects during GC |
Date: |
Sun, 31 May 2020 19:31:00 -0400 (EDT) |
branch: emacs-27
commit 68b6dad1d8e22fe700871c9a5a18da3dd496cc8a
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Be more aggressive in marking objects during GC
Simplified version of a patch from Pip Cet (Bug#41321#299).
* src/alloc.c (maybe_lisp_pointer): Remove. All uses removed.
(mark_memory): Also look at the pointer offset by ‘lispsym’,
for symbols.
---
src/alloc.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/src/alloc.c b/src/alloc.c
index 1c6b664..568fee6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4585,18 +4585,6 @@ mark_maybe_objects (Lisp_Object const *array, ptrdiff_t
nelts)
mark_maybe_object (*array);
}
-/* Return true if P might point to Lisp data that can be garbage
- collected, and false otherwise (i.e., false if it is easy to see
- that P cannot point to Lisp data that can be garbage collected).
- Symbols are implemented via offsets not pointers, but the offsets
- are also multiples of LISP_ALIGNMENT. */
-
-static bool
-maybe_lisp_pointer (void *p)
-{
- return (uintptr_t) p % LISP_ALIGNMENT == 0;
-}
-
/* If P points to Lisp data, mark that as live if it isn't already
marked. */
@@ -4609,9 +4597,6 @@ mark_maybe_pointer (void *p)
VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p));
#endif
- if (!maybe_lisp_pointer (p))
- return;
-
if (pdumper_object_p (p))
{
int type = pdumper_find_object_type (p);
@@ -4715,7 +4700,16 @@ mark_memory (void const *start, void const *end)
for (pp = start; (void const *) pp < end; pp += GC_POINTER_ALIGNMENT)
{
- mark_maybe_pointer (*(void *const *) pp);
+ char *p = *(char *const *) pp;
+ mark_maybe_pointer (p);
+
+ /* Unmask any struct Lisp_Symbol pointer that make_lisp_symbol
+ previously disguised by adding the address of 'lispsym'.
+ On a host with 32-bit pointers and 64-bit Lisp_Objects,
+ a Lisp_Object might be split into registers saved into
+ non-adjacent words and P might be the low-order word's value. */
+ p += (intptr_t) lispsym;
+ mark_maybe_pointer (p);
verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0);
if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 68b6dad: Be more aggressive in marking objects during GC,
Paul Eggert <=