GNU bug report logs - #48264
28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> catern.com>

Date: Thu, 6 May 2021 20:25:01 UTC

Severity: normal

Found in version 28.0.50

Full log


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

From: Spencer Baugh <sbaugh <at> catern.com>
To: 48264 <at> debbugs.gnu.org
Cc: Spencer Baugh <sbaugh <at> catern.com>
Subject: [PATCH v3 13/15] Assert that PER_BUFFER_IDX for Lisp variables is not
 0
Date: Thu,  6 May 2021 17:33:44 -0400
PER_BUFFER_IDX can't be 0 for Lisp variables - so this if-check was
always pointless.

* src/data.c (default_value): Change if to eassert
---
 src/data.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/data.c b/src/data.c
index 49a4bc3bea..4e58c6c815 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1758,8 +1758,8 @@ default_value (Lisp_Object symbol)
 	if (BUFFER_OBJFWDP (valcontents))
 	  {
 	    int offset = XBUFFER_OBJFWD (valcontents)->offset;
-	    if (PER_BUFFER_IDX (offset) != 0)
-	      return per_buffer_default (offset);
+	    eassert (PER_BUFFER_IDX (offset) != 0);
+            return per_buffer_default (offset);
 	  }
 
 	/* For other variables, get the current value.  */
-- 
2.31.1





This bug report was last modified 2 years and 290 days ago.

Previous Next


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