comparison src/eval.c @ 887:ccc3177ef10b

[xemacs-hg @ 2002-06-28 14:21:41 by michaels] 2002-06-27 Mike Sperber <mike@xemacs.org> * eval.c (Ffuncall): Run `post-gc-hook' if GC just happened. * alloc.c (garbage_collect_1): Delay running `post-gc-hook' until later.
author michaels
date Fri, 28 Jun 2002 14:21:41 +0000
parents 79c6ff3eef26
children 111c4f2ed9c9
comparison
equal deleted inserted replaced
886:011e1bce6ece 887:ccc3177ef10b
244 Lisp_Object Qand_rest, Qand_optional; 244 Lisp_Object Qand_rest, Qand_optional;
245 Lisp_Object Qdebug_on_error, Qstack_trace_on_error; 245 Lisp_Object Qdebug_on_error, Qstack_trace_on_error;
246 Lisp_Object Qdebug_on_signal, Qstack_trace_on_signal; 246 Lisp_Object Qdebug_on_signal, Qstack_trace_on_signal;
247 Lisp_Object Qdebugger; 247 Lisp_Object Qdebugger;
248 Lisp_Object Qinhibit_quit; 248 Lisp_Object Qinhibit_quit;
249 Lisp_Object Qfinalize_list;
249 Lisp_Object Qrun_hooks; 250 Lisp_Object Qrun_hooks;
250 Lisp_Object Qsetq; 251 Lisp_Object Qsetq;
251 Lisp_Object Qdisplay_warning; 252 Lisp_Object Qdisplay_warning;
252 Lisp_Object Vpending_warnings, Vpending_warnings_tail; 253 Lisp_Object Vpending_warnings, Vpending_warnings_tail;
253 Lisp_Object Qif; 254 Lisp_Object Qif;
3684 { 3685 {
3685 xemacs_c_alloca (0); 3686 xemacs_c_alloca (0);
3686 funcall_alloca_count = 0; 3687 funcall_alloca_count = 0;
3687 } 3688 }
3688 } 3689 }
3690 if (need_to_signal_post_gc)
3691 {
3692 static void run_post_gc_hook(void); /* forward */
3693
3694 need_to_signal_post_gc = 0;
3695 recompute_funcall_allocation_flag();
3696 run_post_gc_hook();
3697 }
3689 } 3698 }
3690 3699
3691 if (++lisp_eval_depth > max_lisp_eval_depth) 3700 if (++lisp_eval_depth > max_lisp_eval_depth)
3692 { 3701 {
3693 if (max_lisp_eval_depth < 100) 3702 if (max_lisp_eval_depth < 100)
5509 RETURN_UNGCPRO (run_hook_with_args_in_buffer_trapping_problems 5518 RETURN_UNGCPRO (run_hook_with_args_in_buffer_trapping_problems
5510 (warning_string, buf, nargs + 1, funcall_args, 5519 (warning_string, buf, nargs + 1, funcall_args,
5511 RUN_HOOKS_TO_COMPLETION, flags)); 5520 RUN_HOOKS_TO_COMPLETION, flags));
5512 } 5521 }
5513 5522
5523 static void
5524 run_post_gc_hook()
5525 {
5526 Lisp_Object args[2];
5527
5528 args[0] = Qpost_gc_hook;
5529 args[1] = Fcons (Fcons (Qfinalize_list, zap_finalize_list()), Qnil);
5530
5531 run_hook_with_args_trapping_problems
5532 ("Error in post-gc-hook",
5533 2, args,
5534 RUN_HOOKS_TO_COMPLETION,
5535 INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION);
5536 }
5514 5537
5515 /************************************************************************/ 5538 /************************************************************************/
5516 /* The special binding stack */ 5539 /* The special binding stack */
5517 /* Most C code should simply use specbind() and unbind_to_1(). */ 5540 /* Most C code should simply use specbind() and unbind_to_1(). */
5518 /* When performance is critical, use the macros in backtrace.h. */ 5541 /* When performance is critical, use the macros in backtrace.h. */
6222 DEFSYMBOL (Qdefun); 6245 DEFSYMBOL (Qdefun);
6223 DEFSYMBOL (Qprogn); 6246 DEFSYMBOL (Qprogn);
6224 DEFSYMBOL (Qvalues); 6247 DEFSYMBOL (Qvalues);
6225 DEFSYMBOL (Qdisplay_warning); 6248 DEFSYMBOL (Qdisplay_warning);
6226 DEFSYMBOL (Qrun_hooks); 6249 DEFSYMBOL (Qrun_hooks);
6250 DEFSYMBOL (Qfinalize_list);
6227 DEFSYMBOL (Qif); 6251 DEFSYMBOL (Qif);
6228 6252
6229 DEFSUBR (For); 6253 DEFSUBR (For);
6230 DEFSUBR (Fand); 6254 DEFSUBR (Fand);
6231 DEFSUBR (Fif); 6255 DEFSUBR (Fif);