comparison src/eval.c @ 66528:c9adaa704c22

(internal_lisp_condition_case): New function. (Fcondition_case): Use internal_lisp_condition_case. (Feval): Test Vmemory_full and memory_full_cons_threshold. (Ffuncall): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 Oct 2005 19:34:12 +0000
parents a0d1312ede66
children 65be704fdaf2
comparison
equal deleted inserted replaced
66527:098219e8d2e8 66528:c9adaa704c22
1341 See also the function `signal' for more info. 1341 See also the function `signal' for more info.
1342 usage: (condition-case VAR BODYFORM &rest HANDLERS) */) 1342 usage: (condition-case VAR BODYFORM &rest HANDLERS) */)
1343 (args) 1343 (args)
1344 Lisp_Object args; 1344 Lisp_Object args;
1345 { 1345 {
1346 register Lisp_Object bodyform, handlers;
1347 volatile Lisp_Object var;
1348
1349 var = Fcar (args);
1350 bodyform = Fcar (Fcdr (args));
1351 handlers = Fcdr (Fcdr (args));
1352
1353 return internal_lisp_condition_case (var, bodyform, handlers);
1354 }
1355
1356 /* Like Fcondition_case, but the args are separate
1357 rather than passed in a list. Used by Fbyte_code. */
1358
1359 Lisp_Object
1360 internal_lisp_condition_case (var, bodyform, handlers)
1361 volatile Lisp_Object var;
1362 Lisp_Object bodyform, handlers;
1363 {
1346 Lisp_Object val; 1364 Lisp_Object val;
1347 struct catchtag c; 1365 struct catchtag c;
1348 struct handler h; 1366 struct handler h;
1349 register Lisp_Object bodyform, handlers; 1367
1350 volatile Lisp_Object var;
1351
1352 var = Fcar (args);
1353 bodyform = Fcar (Fcdr (args));
1354 handlers = Fcdr (Fcdr (args));
1355 CHECK_SYMBOL (var); 1368 CHECK_SYMBOL (var);
1356 1369
1357 for (val = handlers; CONSP (val); val = XCDR (val)) 1370 for (val = handlers; CONSP (val); val = XCDR (val))
1358 { 1371 {
1359 Lisp_Object tem; 1372 Lisp_Object tem;
2092 return Fsymbol_value (form); 2105 return Fsymbol_value (form);
2093 if (!CONSP (form)) 2106 if (!CONSP (form))
2094 return form; 2107 return form;
2095 2108
2096 QUIT; 2109 QUIT;
2097 if (consing_since_gc > gc_cons_threshold 2110 if ((consing_since_gc > gc_cons_threshold
2098 && consing_since_gc > gc_relative_threshold) 2111 && consing_since_gc > gc_relative_threshold)
2112 ||
2113 (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold))
2099 { 2114 {
2100 GCPRO1 (form); 2115 GCPRO1 (form);
2101 Fgarbage_collect (); 2116 Fgarbage_collect ();
2102 UNGCPRO; 2117 UNGCPRO;
2103 } 2118 }
2793 struct backtrace backtrace; 2808 struct backtrace backtrace;
2794 register Lisp_Object *internal_args; 2809 register Lisp_Object *internal_args;
2795 register int i; 2810 register int i;
2796 2811
2797 QUIT; 2812 QUIT;
2798 if (consing_since_gc > gc_cons_threshold 2813 if ((consing_since_gc > gc_cons_threshold
2799 && consing_since_gc > gc_relative_threshold) 2814 && consing_since_gc > gc_relative_threshold)
2815 ||
2816 (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold))
2800 Fgarbage_collect (); 2817 Fgarbage_collect ();
2801 2818
2802 if (++lisp_eval_depth > max_lisp_eval_depth) 2819 if (++lisp_eval_depth > max_lisp_eval_depth)
2803 { 2820 {
2804 if (max_lisp_eval_depth < 100) 2821 if (max_lisp_eval_depth < 100)