emacs-diffs
[Top][All Lists]
Advanced

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

pkg bdca01dd38 29/76: Workaround for something Stefan missed


From: Gerd Moellmann
Subject: pkg bdca01dd38 29/76: Workaround for something Stefan missed
Date: Fri, 21 Oct 2022 00:16:11 -0400 (EDT)

branch: pkg
commit bdca01dd38636d77279ae29aed132df3a21389ff
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    Workaround for something Stefan missed
    
    See comment there for an explanation.
    
    * src/alloc.c (xmake_pure_vector): Former make_pure_vector.
    (init_vectors): Use it to allocate zero_vecgtor.
---
 src/alloc.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index e8a1688104..3b1d7cf0b2 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3030,6 +3030,23 @@ allocate_vector_from_block (ptrdiff_t nbytes);
 
 /* Called once to initialize vector allocation.  */
 
+
+/* PKG-FIXME: Stefan's original patch allocates the zero vector
+   from a block, which doesn't work because that code is not
+   prepared to handle allocations of that size.  Do it as before
+   Stefan's patch, because I don't want to deal with it now.  */
+
+static Lisp_Object
+xmake_pure_vector (ptrdiff_t len)
+{
+  Lisp_Object new;
+  size_t size = header_size + len * word_size;
+  struct Lisp_Vector *p = pure_alloc (size, Lisp_Vectorlike);
+  XSETVECTOR (new, p);
+  XVECTOR (new)->header.size = len;
+  return new;
+}
+
 static void
 init_vectors (void)
 {
@@ -3041,9 +3058,7 @@ init_vectors (void)
      normal heap, e.g. as a static object, and then to "hide" it from the GC,
      for example by marking it by hand at the beginning of the GC and unmarking
      it by hand at the end.  */
-  struct Lisp_Vector *zv = allocate_vector_from_block (vroundup (header_size));
-  zv->header.size = 0;
-  zero_vector = make_lisp_ptr (zv, Lisp_Vectorlike);
+  zero_vector = xmake_pure_vector (0);
   staticpro (&zero_vector);
 }
 



reply via email to

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