aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c43
-rw-r--r--src/xdisp.c4
2 files changed, 13 insertions, 34 deletions
diff --git a/src/alloc.c b/src/alloc.c
index e241b9933a4..124b50d0d3f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4687,35 +4687,6 @@ mark_maybe_objects (Lisp_Object const *array, ptrdiff_t nelts)
4687 mark_maybe_object (*array); 4687 mark_maybe_object (*array);
4688} 4688}
4689 4689
4690/* A lower bound on the alignment of Lisp objects that need marking.
4691 Although 1 is safe, higher values speed up mark_maybe_pointer.
4692 If USE_LSB_TAG, this value is typically GCALIGNMENT; otherwise,
4693 it's determined by the natural alignment of Lisp structs.
4694 All vectorlike objects have alignment at least that of union
4695 vectorlike_header and it's unlikely they all have alignment greater,
4696 so use the union as a safe and likely-accurate standin for
4697 vectorlike objects. */
4698
4699enum { GC_OBJECT_ALIGNMENT_MINIMUM
4700 = max (GCALIGNMENT,
4701 min (alignof (union vectorlike_header),
4702 min (min (alignof (struct Lisp_Cons),
4703 alignof (struct Lisp_Float)),
4704 min (alignof (struct Lisp_String),
4705 alignof (struct Lisp_Symbol))))) };
4706
4707/* Return true if P might point to Lisp data that can be garbage
4708 collected, and false otherwise (i.e., false if it is easy to see
4709 that P cannot point to Lisp data that can be garbage collected).
4710 Symbols are implemented via offsets not pointers, but the offsets
4711 are also multiples of GC_OBJECT_ALIGNMENT_MINIMUM. */
4712
4713static bool
4714maybe_lisp_pointer (void *p)
4715{
4716 return (uintptr_t) p % GC_OBJECT_ALIGNMENT_MINIMUM == 0;
4717}
4718
4719/* If P points to Lisp data, mark that as live if it isn't already 4690/* If P points to Lisp data, mark that as live if it isn't already
4720 marked. */ 4691 marked. */
4721 4692
@@ -4728,9 +4699,6 @@ mark_maybe_pointer (void *p)
4728 VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); 4699 VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p));
4729#endif 4700#endif
4730 4701
4731 if (!maybe_lisp_pointer (p))
4732 return;
4733
4734 if (pdumper_object_p (p)) 4702 if (pdumper_object_p (p))
4735 { 4703 {
4736 int type = pdumper_find_object_type (p); 4704 int type = pdumper_find_object_type (p);
@@ -4830,7 +4798,16 @@ mark_memory (void const *start, void const *end)
4830 4798
4831 for (pp = start; (void const *) pp < end; pp += GC_POINTER_ALIGNMENT) 4799 for (pp = start; (void const *) pp < end; pp += GC_POINTER_ALIGNMENT)
4832 { 4800 {
4833 mark_maybe_pointer (*(void *const *) pp); 4801 char *p = *(char *const *) pp;
4802 mark_maybe_pointer (p);
4803
4804 /* Unmask any struct Lisp_Symbol pointer that make_lisp_symbol
4805 previously disguised by adding the address of 'lispsym'.
4806 On a host with 32-bit pointers and 64-bit Lisp_Objects,
4807 a Lisp_Object might be split into registers saved into
4808 non-adjacent words and P might be the low-order word's value. */
4809 p += (intptr_t) lispsym;
4810 mark_maybe_pointer (p);
4834 4811
4835 verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0); 4812 verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0);
4836 if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT 4813 if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT
diff --git a/src/xdisp.c b/src/xdisp.c
index ea28395cf55..0f06a38d405 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11575,7 +11575,9 @@ display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2)
11575 /* Display. */ 11575 /* Display. */
11576 clear_glyph_matrix (w->desired_matrix); 11576 clear_glyph_matrix (w->desired_matrix);
11577 XSETWINDOW (window, w); 11577 XSETWINDOW (window, w);
11578 void *itdata = bidi_shelve_cache ();
11578 try_window (window, start, 0); 11579 try_window (window, start, 0);
11580 bidi_unshelve_cache (itdata, false);
11579 11581
11580 return window_height_changed_p; 11582 return window_height_changed_p;
11581} 11583}
@@ -19748,7 +19750,7 @@ find_last_row_displaying_text (struct glyph_matrix *matrix, struct it *it,
19748 by changes at the start of current_buffer that occurred since W's 19750 by changes at the start of current_buffer that occurred since W's
19749 current matrix was built. Value is null if no such row exists. 19751 current matrix was built. Value is null if no such row exists.
19750 19752
19751 BEG_UNCHANGED us the number of characters unchanged at the start of 19753 BEG_UNCHANGED is the number of characters unchanged at the start of
19752 current_buffer. BEG + BEG_UNCHANGED is the buffer position of the 19754 current_buffer. BEG + BEG_UNCHANGED is the buffer position of the
19753 first changed character in current_buffer. Characters at positions < 19755 first changed character in current_buffer. Characters at positions <
19754 BEG + BEG_UNCHANGED are at the same buffer positions as they were 19756 BEG + BEG_UNCHANGED are at the same buffer positions as they were