GNU bug report logs - #75318
Lisp_Subr header and layout

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> protonmail.com>

Date: Fri, 3 Jan 2025 14:31:02 UTC

Severity: normal

Full log


Message #8 received at 75318 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: 75318 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#75318: Lisp_Subr header and layout
Date: Tue, 21 Jan 2025 13:04:48 +0000
"Pip Cet via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <bug-gnu-emacs <at> gnu.org> writes:

> I'll prepare patches for those two changes (remove command_modes;
> correct pvec headers for subrs); not the third (reorder Lisp_Subr
> fields) because it's a nativecomp change, and there may be a small
> performance impact.

The first patch is a simple bug fix. Is this okay?

PVECHEADERSIZE uses "lispsize" and "restsize", but allocate_pseudovector
uses "memlen" and "lisplen".  That's confusing.  Someone was confused,
the header value was wrong but it never caused any trouble.  Still, it's
good to fix this, and it caused trouble for feature/igc.

Ideally, we would fix the confusing situation.  My suggestion is to
always pass all three sizes.  Please let me know if that's desirable.

From 08fd00deb5d4d7ea73d2959577d2b4ab9855f1c2 Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet <at> protonmail.com>
Subject: [PATCH 1/2] Correct PVEC header for main_thread (bug#75318)

* src/thread.c (main_thread): Pass correct restsize to PVECHEADERSIZE.
---
 src/thread.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/thread.c b/src/thread.c
index 5610f8be0dd..5539fae15ab 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -50,7 +50,9 @@ static_assert (GCALIGNED (union aligned_thread_state));
       .header.size = PVECHEADERSIZE (PVEC_THREAD,
 				     PSEUDOVECSIZE (struct thread_state,
 						    event_object),
-				     VECSIZE (struct thread_state)),
+				     VECSIZE (struct thread_state) -
+				     PSEUDOVECSIZE (struct thread_state,
+						    event_object)),
       .m_last_thing_searched = LISPSYM_INITIALLY (Qnil),
       .m_saved_last_thing_searched = LISPSYM_INITIALLY (Qnil),
       .name = LISPSYM_INITIALLY (Qnil),
-- 
2.47.1






This bug report was last modified 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.