changeset 26297:4d1e267efd41

[DEBUG_GCPRO] (gcpro_level): New variable. (init_eval) [DEBUG_GCPRO]: Initialize it. (unwind_to_catch) [DEBUG_GCPRO]: Set gcpro_level from remaining gcprolist.
author Richard M. Stallman <rms@gnu.org>
date Mon, 01 Nov 1999 23:19:20 +0000
parents e5c745f5a9fc
children 759384838eae
files src/eval.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Mon Nov 01 23:16:22 1999 +0000
+++ b/src/eval.c	Mon Nov 01 23:19:20 1999 +0000
@@ -85,6 +85,11 @@
 
 struct catchtag *catchlist;
 
+#ifdef DEBUG_GCPRO
+/* Count levels of GCPRO to detect failure to UNGCPRO.  */
+int gcpro_level;
+#endif
+
 Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
 Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag;
 Lisp_Object Qmocklisp_arguments, Vmocklisp_arguments, Qmocklisp;
@@ -185,6 +190,7 @@
   Vquit_flag = Qnil;
   debug_on_next_call = 0;
   lisp_eval_depth = 0;
+  gcpro_level = 0;
   /* This is less than the initial value of num_nonmacro_input_events.  */
   when_entered_debugger = -1;
 }
@@ -967,6 +973,12 @@
   while (! last_time);
 
   gcprolist = catch->gcpro;
+#ifdef DEBUG_GCPRO
+  if (gcprolist != 0)
+    gcpro_level = gcprolist->level + 1;
+  else
+    gcpro_level = 0;
+#endif
   backtrace_list = catch->backlist;
   lisp_eval_depth = catch->lisp_eval_depth;