]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid staticvec duplicates
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Mar 2019 19:05:40 +0000 (11:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Mar 2019 19:06:40 +0000 (11:06 -0800)
* 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
src/keyboard.c

index 7d63e3c79b67add58dd7246c7e0c5d7a74cb3bee..452d31f9398b1de65468f61bf6cf38ed10b30602 100644 (file)
@@ -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;
index 6e805ec7e69af83d9cedc6f8e8dd30b0309f0e7f..380744583730f8bd1b1a3a3750ddda55472ffad5 100644 (file)
@@ -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;
 }