emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 90b8762ac84 2/3: Replace PVEC_FONT as pseudo-vector subtype upper


From: Mattias Engdegård
Subject: master 90b8762ac84 2/3: Replace PVEC_FONT as pseudo-vector subtype upper bound
Date: Sun, 10 Sep 2023 09:17:28 -0400 (EDT)

branch: master
commit 90b8762ac84b75e0365aead585752a0a8f682b05
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Replace PVEC_FONT as pseudo-vector subtype upper bound
    
    * src/lisp.h (enum pvec_type): Add PVEC_TAG_MAX.
    * src/alloc.c (allocate_pseudovector): Use PVEC_TAG_MAX instead of
    PVEC_FONT.
---
 src/alloc.c | 2 +-
 src/lisp.h  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index c77bdc6372d..c0086a70fc1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3613,7 +3613,7 @@ allocate_pseudovector (int memlen, int lisplen,
   enum { size_max = (1 << PSEUDOVECTOR_SIZE_BITS) - 1 };
   enum { rest_max = (1 << PSEUDOVECTOR_REST_BITS) - 1 };
   verify (size_max + rest_max <= VECTOR_ELTS_MAX);
-  eassert (0 <= tag && tag <= PVEC_FONT);
+  eassert (0 <= tag && tag <= PVEC_TAG_MAX);
   eassert (0 <= lisplen && lisplen <= zerolen && zerolen <= memlen);
   eassert (lisplen <= size_max);
   eassert (memlen <= size_max + rest_max);
diff --git a/src/lisp.h b/src/lisp.h
index 153fb5c0dbc..50b68f2e767 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1086,7 +1086,8 @@ enum pvec_type
   PVEC_CHAR_TABLE,
   PVEC_SUB_CHAR_TABLE,
   PVEC_RECORD,
-  PVEC_FONT /* Should be last because it's used for range checking.  */
+  PVEC_FONT,
+  PVEC_TAG_MAX = PVEC_FONT  /* Keep this equal to the highest member.  */
 };
 
 enum More_Lisp_Bits



reply via email to

[Prev in Thread] Current Thread [Next in Thread]