unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@catern.com>
To: 48264@debbugs.gnu.org
Cc: Spencer Baugh <sbaugh@catern.com>
Subject: bug#48264: [PATCH v3 11/15] Delete SET_PER_BUFFER_VALUE_P and buffer local_flags field
Date: Thu,  6 May 2021 17:33:42 -0400	[thread overview]
Message-ID: <20210506213346.9730-12-sbaugh@catern.com> (raw)
In-Reply-To: <877dkbsj9d.fsf@catern.com>

* src/buffer.h (struct buffer): Remove local_flags field.
(SET_PER_BUFFER_VALUE_P): Remove.
(KILL_PER_BUFFER_VALUE): Stop using SET_PER_BUFFER_VALUE_P.
* src/buffer.c (Fget_buffer_create, clone_per_buffer_values)
(Fmake_indirect_buffer): Stop initializing local_flags.
* src/category.c (Fset_category_table):
* src/data.c (store_symval_forwarding):
* src/syntax.c (Fset_syntax_table):
Stop using SET_PER_BUFFER_VALUE_P.
* src/pdumper.c (dump_buffer):
Stop dumping local_flags field.
---
 src/buffer.c   |  6 ------
 src/buffer.h   | 19 -------------------
 src/category.c |  4 ----
 src/data.c     |  3 ---
 src/pdumper.c  |  3 ---
 src/syntax.c   |  4 ----
 6 files changed, 39 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c
index 9363aabddc..3ece2f5b15 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -561,8 +561,6 @@ even if it is dead.  The return value is never nil.  */)
   /* No one shows us now.  */
   b->window_count = 0;
 
-  memset (&b->local_flags, 0, sizeof (b->local_flags));
-
   BUF_GAP_SIZE (b) = 20;
   block_input ();
   /* We allocate extra 1-byte at the tail and keep it always '\0' for
@@ -718,8 +716,6 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to)
       set_per_buffer_value (to, offset, obj);
     }
 
-  memcpy (to->local_flags, from->local_flags, sizeof to->local_flags);
-
   set_buffer_overlays_before (to, copy_overlays (to, from->overlays_before));
   set_buffer_overlays_after (to, copy_overlays (to, from->overlays_after));
 
@@ -821,8 +817,6 @@ CLONE nil means the indirect buffer's state is reset to default values.  */)
   /* Always -1 for an indirect buffer.  */
   b->window_count = -1;
 
-  memset (&b->local_flags, 0, sizeof (b->local_flags));
-
   b->pt = b->base_buffer->pt;
   b->begv = b->base_buffer->begv;
   b->zv = b->base_buffer->zv;
diff --git a/src/buffer.h b/src/buffer.h
index ee5924dad8..e55cbcdd94 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -605,13 +605,6 @@ struct buffer
      an indirect buffer since it counts as its base buffer.  */
   int window_count;
 
-  /* A non-zero value in slot IDX means that per-buffer variable
-     with index IDX has a local value in this buffer.  The index IDX
-     for a buffer-local variable is stored in that variable's slot
-     in buffer_local_flags as a Lisp integer.  If the index is -1,
-     this means the variable is always local in all buffers.  */
-  char local_flags[MAX_PER_BUFFER_VARS];
-
   /* Set to the modtime of the visited file when read or written.
      modtime.tv_nsec == NONEXISTENT_MODTIME_NSECS means
      visited file was nonexistent.  modtime.tv_nsec ==
@@ -1418,16 +1411,6 @@ OVERLAY_POSITION (Lisp_Object p)
 
 extern bool valid_per_buffer_idx (int);
 
-/* Set whether per-buffer variable with index IDX has a buffer-local
-   value in buffer B.  VAL zero means it hasn't.  */
-
-INLINE void
-SET_PER_BUFFER_VALUE_P (struct buffer *b, int idx, bool val)
-{
-  eassert (valid_per_buffer_idx (idx));
-  b->local_flags[idx] = val;
-}
-
 /* Return the index value of the per-buffer variable at offset OFFSET
    in the buffer structure.
 
@@ -1517,8 +1500,6 @@ bvar_get (struct buffer *b, ptrdiff_t offset)
 INLINE void
 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, Qunbound);
 }
 
diff --git a/src/category.c b/src/category.c
index 522f4da697..a9f5225df8 100644
--- a/src/category.c
+++ b/src/category.c
@@ -268,12 +268,8 @@ DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0,
 Return TABLE.  */)
   (Lisp_Object table)
 {
-  int idx;
   table = check_category_table (table);
   bset_category_table (current_buffer, table);
-  /* Indicate that this buffer now has a specified category table.  */
-  idx = PER_BUFFER_VAR_IDX (category_table);
-  SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
   return table;
 }
 
diff --git a/src/data.c b/src/data.c
index 04c27b4940..49a4bc3bea 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1295,9 +1295,6 @@ store_symval_forwarding (lispfwd valcontents, Lisp_Object newval,
 	if (buf == NULL)
 	  buf = current_buffer;
 	set_per_buffer_value (buf, offset, newval);
-        int idx = PER_BUFFER_IDX (offset);
-        if (idx > 0)
-          SET_PER_BUFFER_VALUE_P (buf, idx, 1);
       }
       break;
 
diff --git a/src/pdumper.c b/src/pdumper.c
index dfc7388b63..1e2e5238c7 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2802,9 +2802,6 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
   DUMP_FIELD_COPY (out, buffer, indirections);
   DUMP_FIELD_COPY (out, buffer, window_count);
 
-  memcpy (out->local_flags,
-          &buffer->local_flags,
-          sizeof (out->local_flags));
   DUMP_FIELD_COPY (out, buffer, modtime);
   DUMP_FIELD_COPY (out, buffer, modtime_size);
   DUMP_FIELD_COPY (out, buffer, auto_save_modified);
diff --git a/src/syntax.c b/src/syntax.c
index 6ea92beb7c..4724b39097 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1042,12 +1042,8 @@ DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0,
 One argument, a syntax table.  */)
   (Lisp_Object table)
 {
-  int idx;
   check_syntax_table (table);
   bset_syntax_table (current_buffer, table);
-  /* Indicate that this buffer now has a specified syntax table.  */
-  idx = PER_BUFFER_VAR_IDX (syntax_table);
-  SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
   return table;
 }
 \f
-- 
2.31.1






  parent reply	other threads:[~2021-05-06 21:33 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 20:24 bug#48264: 28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 00/15] Speeding up setting the default for DEFVAR_PER_BUFFER vars Spencer Baugh
2021-05-07 11:05   ` Eli Zaretskii
2021-05-08  2:08   ` bug#48264: [PATCH v4 " Spencer Baugh
2021-05-08  2:08     ` Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 01/14] Stop checking the constant default for enable_multibyte_characters Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 02/14] Take offset not idx in PER_BUFFER_VALUE_P Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 03/14] Add and use BVAR_HAS_DEFAULT_VALUE_P Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 04/14] Combine unnecessarily separate loops in buffer.c Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 05/14] Add and use KILL_PER_BUFFER_VALUE Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 06/14] Rearrange set_internal for buffer forwarded symbols Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 07/14] Use BVAR_OR_DEFAULT for per-buffer vars with defaults Spencer Baugh
2021-05-08  2:08     ` bug#48264: [PATCH v4 08/14] Remove unnecessary Qunbound check Spencer Baugh
2021-05-08  2:09     ` bug#48264: [PATCH v4 09/14] Get rid of buffer_permanent_local_flags array Spencer Baugh
2021-05-08  2:09     ` bug#48264: [PATCH v4 10/14] Delete SET_PER_BUFFER_VALUE_P and buffer local_flags field Spencer Baugh
2021-05-08  2:09     ` bug#48264: [PATCH v4 11/14] Set buffer_defaults fields without a default to Qunbound Spencer Baugh
2021-05-08  2:09     ` bug#48264: [PATCH v4 12/14] Assert that PER_BUFFER_IDX for Lisp variables is not 0 Spencer Baugh
2021-05-08  2:09     ` bug#48264: [PATCH v4 13/14] Remove PER_BUFFER_IDX and buffer_local_flags Spencer Baugh
2021-05-08  2:09     ` bug#48264: [PATCH v4 14/14] Add and use BVAR_FIELD macros Spencer Baugh
2021-05-08 18:06     ` bug#48264: [PATCH v4 00/15] Speeding up setting the default for DEFVAR_PER_BUFFER vars Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-06 21:33 ` bug#48264: [PATCH v3 01/15] Stop checking the constant default for enable_multibyte_characters Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 02/15] Take offset not idx in PER_BUFFER_VALUE_P Spencer Baugh
2021-05-07  7:27   ` Eli Zaretskii
2021-05-07 12:45     ` Spencer Baugh
2021-05-07 12:54       ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 03/15] Add and use BUFFER_DEFAULT_VALUE_P Spencer Baugh
2021-05-07  7:29   ` Eli Zaretskii
2021-05-07 12:49     ` Spencer Baugh
2021-05-07 12:58       ` Eli Zaretskii
2021-05-07 13:38         ` Spencer Baugh
2021-05-07 13:42           ` Eli Zaretskii
2021-05-07 14:30             ` Spencer Baugh
2021-05-07 14:39               ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 04/15] Combine unnecessarily separate loops in buffer.c Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 05/15] Add and use KILL_PER_BUFFER_VALUE Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 06/15] Rearrange set_internal for buffer forwarded symbols Spencer Baugh
2021-05-07 10:45   ` Eli Zaretskii
2021-05-07 14:26     ` Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 07/15] Add BVAR_OR_DEFAULT macro as a stub Spencer Baugh
2021-05-07 10:54   ` Eli Zaretskii
2021-05-07 13:05     ` Spencer Baugh
2021-05-07 13:12       ` Eli Zaretskii
2021-05-07 13:24         ` Spencer Baugh
2021-05-07 13:32           ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 08/15] Set non-buffer-local BVARs to Qunbound Spencer Baugh
2021-05-07 10:37   ` Eli Zaretskii
2021-05-07 12:54     ` Spencer Baugh
2021-05-07 13:00       ` Eli Zaretskii
2021-05-06 21:33 ` bug#48264: [PATCH v3 09/15] Remove unnecessary Qunbound check Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 10/15] Get rid of buffer_permanent_local_flags array Spencer Baugh
2021-05-06 21:33 ` Spencer Baugh [this message]
2021-05-06 21:33 ` bug#48264: [PATCH v3 12/15] Set buffer_defaults fields without a default to Qunbound Spencer Baugh
2021-05-07 10:42   ` Eli Zaretskii
2021-05-07 13:20     ` Spencer Baugh
2021-05-07 13:29       ` Eli Zaretskii
2021-05-07 14:15         ` Spencer Baugh
2021-05-07 14:30           ` Eli Zaretskii
2021-05-07 21:35             ` Spencer Baugh
2021-05-08  6:40               ` Eli Zaretskii
2021-05-08 13:22                 ` Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 13/15] Assert that PER_BUFFER_IDX for Lisp variables is not 0 Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 14/15] Remove PER_BUFFER_IDX and buffer_local_flags Spencer Baugh
2021-05-06 21:33 ` bug#48264: [PATCH v3 15/15] Add and use BVAR_FIELD macros Spencer Baugh
2021-05-07 11:03   ` Eli Zaretskii
2021-05-07 12:59     ` Spencer Baugh
2021-05-07 13:08       ` Eli Zaretskii
2021-05-07 21:43         ` Spencer Baugh
2021-05-08  6:55           ` Eli Zaretskii
2021-05-08 13:35             ` Spencer Baugh
2021-05-08 13:58               ` Eli Zaretskii
2021-05-08 17:13                 ` Spencer Baugh
2021-05-08 19:03                 ` Spencer Baugh
2021-05-09  8:10                   ` Eli Zaretskii
2021-05-09 17:09                     ` Spencer Baugh
2021-05-09 17:09                       ` bug#48264: [PATCH 1/2] Take buffer field name in DEFVAR_PER_BUFFER Spencer Baugh
2021-05-09 17:09                       ` bug#48264: [PATCH 2/2] Add compile-time check that BVAR is used correctly Spencer Baugh
2021-05-09 18:09                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-09 18:29                           ` Eli Zaretskii
2021-05-10 14:09                             ` Spencer Baugh
2022-07-01 12:18                               ` bug#48264: 28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time Lars Ingebrigtsen
2022-07-01 18:49                                 ` Spencer Baugh
2022-07-02 12:00                                   ` Lars Ingebrigtsen
2022-08-02 11:11                                     ` Lars Ingebrigtsen
2021-05-09 10:08                 ` bug#48264: [PATCH v3 15/15] Add and use BVAR_FIELD macros Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210506213346.9730-12-sbaugh@catern.com \
    --to=sbaugh@catern.com \
    --cc=48264@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).