emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 5f99d51: Avoid staticvec duplicates


From: Paul Eggert
Subject: [Emacs-diffs] master 5f99d51: Avoid staticvec duplicates
Date: Sat, 2 Mar 2019 14:06:45 -0500 (EST)

branch: master
commit 5f99d515c921ee5546483ddab15e08f9b23280d9
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Avoid staticvec duplicates
    
    * src/alloc.c (staticpro) [ENABLE_CHECKING]: Check for duplicates.
    * src/keyboard.c (syms_of_keyboard): Define
    while-no-input-ignore-events and inhibit--record-char here ...
    (syms_of_keyboard_for_pdumper): ... instead of here.
    This avoids duplicates in staticvec.
---
 src/alloc.c    |  2 ++
 src/keyboard.c | 20 +++++++++++---------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index 7d63e3c..452d31f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5725,6 +5725,8 @@ purecopy (Lisp_Object obj)
 void
 staticpro (Lisp_Object *varaddress)
 {
+  for (int i = 0; i < staticidx; i++)
+    eassert (staticvec[i] != varaddress);
   if (staticidx >= NSTATICS)
     fatal ("NSTATICS too small; try increasing and recompiling Emacs.");
   staticvec[staticidx++] = varaddress;
diff --git a/src/keyboard.c b/src/keyboard.c
index 6e805ec..3807445 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11844,6 +11844,17 @@ preserve data in modified buffers that would otherwise 
be lost.
 If nil, Emacs crashes immediately in response to fatal signals.  */);
   attempt_orderly_shutdown_on_fatal_signal = true;
 
+  DEFVAR_LISP ("while-no-input-ignore-events",
+               Vwhile_no_input_ignore_events,
+               doc: /* Ignored events from while-no-input.  */);
+
+  DEFVAR_BOOL ("inhibit--record-char",
+              inhibit_record_char,
+              doc: /* If non-nil, don't record input events.
+This inhibits recording input events for the purposes of keyboard
+macros, dribble file, and `recent-keys'.
+Internal use only.  */);
+
   pdumper_do_now_and_after_load (syms_of_keyboard_for_pdumper);
 }
 
@@ -11878,17 +11889,8 @@ syms_of_keyboard_for_pdumper (void)
   eassert (initial_kboard == NULL);
   initial_kboard = allocate_kboard (Qt);
 
-  DEFVAR_LISP ("while-no-input-ignore-events",
-               Vwhile_no_input_ignore_events,
-               doc: /* Ignored events from while-no-input.  */);
   Vwhile_no_input_ignore_events = Qnil;
 
-  DEFVAR_BOOL ("inhibit--record-char",
-              inhibit_record_char,
-              doc: /* If non-nil, don't record input events.
-This inhibits recording input events for the purposes of keyboard
-macros, dribble file, and `recent-keys'.
-Internal use only.  */);
   inhibit_record_char = false;
 }
 



reply via email to

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