[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/igc 9e7684a6504 2/3: Next attempt at fix_font
From: |
Gerd Moellmann |
Subject: |
scratch/igc 9e7684a6504 2/3: Next attempt at fix_font |
Date: |
Mon, 29 Apr 2024 03:46:31 -0400 (EDT) |
branch: scratch/igc
commit 9e7684a6504f673169e772a4ea428981b616e45a
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Gerd Möllmann <gerd@gnu.org>
Next attempt at fix_font
* src/igc.c (fix_font): This time, dispatch on the length.
(fix_vector): Call it.
---
src/igc.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/igc.c b/src/igc.c
index 8ea7ee0581c..36239c75004 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -1625,6 +1625,31 @@ fix_obarray (mps_ss_t ss, struct Lisp_Obarray *o)
}
#endif
+static mps_res_t
+fix_font (mps_ss_t ss, struct Lisp_Vector *v)
+{
+ MPS_SCAN_BEGIN (ss)
+ {
+ IGC_FIX_CALL_FN (ss, struct Lisp_Vector, v, fix_vectorlike);
+ /* See font.h for the magic numbers. */
+ switch (v->header.size & PSEUDOVECTOR_SIZE_MASK)
+ {
+ case FONT_SPEC_MAX:
+ case FONT_ENTITY_MAX:
+ break;
+ case FONT_OBJECT_MAX:
+ struct font *f = (struct font *)v;
+ Lisp_Object const *type = &f->driver->type;
+ IGC_FIX12_OBJ (ss, (Lisp_Object *)type);
+ break;
+ default:
+ emacs_abort ();
+ }
+ }
+ MPS_SCAN_END (ss);
+ return MPS_RES_OK;
+}
+
/* Note that there is a small window after committing a vectorlike
allocation where the object is zeroed, and so the vector header is
also zero. This doesn't have an adverse effect. */
@@ -1728,9 +1753,10 @@ fix_vector (mps_ss_t ss, struct Lisp_Vector *v)
#endif
break;
- /* NB: PVEC_FONT objects come in different varieties having different
- sizes. The only part they have in common are the Lisp_Object
members. */
case PVEC_FONT:
+ IGC_FIX_CALL_FN (ss, struct Lisp_Vector, v, fix_font);
+ break;
+
case PVEC_NORMAL_VECTOR:
case PVEC_SYMBOL_WITH_POS:
case PVEC_PROCESS: