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 #62 received at 48264 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Spencer Baugh <sbaugh <at> catern.com>
Cc: sbaugh <at> catern.com, 48264 <at> debbugs.gnu.org
Subject: Re: bug#48264: [PATCH v3 08/15] Set non-buffer-local BVARs to Qunbound
Date: Fri, 07 May 2021 13:37:53 +0300
> From: Spencer Baugh <sbaugh <at> catern.com>
> Date: Thu,  6 May 2021 17:33:39 -0400
> Cc: Spencer Baugh <sbaugh <at> catern.com>
> 
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -54,8 +54,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
>     defined with DEFVAR_PER_BUFFER, that have special slots in each buffer.
>     The default value occupies the same slot in this structure
>     as an individual buffer's value occupies in that buffer.
> -   Setting the default value also goes through the alist of buffers
> -   and stores into each buffer that does not say it has a local value.  */
> +*/

This is a spurious change, please undo it.

> @@ -1107,8 +1109,7 @@ BUFFER_CHECK_INDIRECTION (struct buffer *b)
>     that have special slots in each buffer.
>     The default value occupies the same slot in this structure
>     as an individual buffer's value occupies in that buffer.
> -   Setting the default value also goes through the alist of buffers
> -   and stores into each buffer that does not say it has a local value.  */
> +*/

Likewise.

> +INLINE Lisp_Object
> +bvar_get (struct buffer *b, ptrdiff_t offset)
   ^^^^^^^^
How about calling this buffer_local_value instead? or maybe
bvar_get_value?

> @@ -1511,7 +1519,7 @@ KILL_PER_BUFFER_VALUE (struct buffer *b, int offset)
>  {
>    int idx = PER_BUFFER_IDX (offset);
>    SET_PER_BUFFER_VALUE_P (b, idx, 0);
> -  set_per_buffer_value (b, offset, per_buffer_default (offset));
> +  set_per_buffer_value (b, offset, Qunbound);
>  }

Hmm... I'm probably missing something here: what about per-buffer
variables that do have default values? how's that implemented in this
new implementation?




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

Previous Next


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