comparison src/alloc.c @ 14959:f2b5d784fa88

(garbage_collection_messages): New variable. (syms_of_alloc): Set up Lisp variable. (Fgarbage_collect): Variable controls whether to display messages.
author Richard M. Stallman <rms@gnu.org>
date Mon, 08 Apr 1996 14:05:57 +0000
parents 26224976a917
children 5cd52d4838f8
comparison
equal deleted inserted replaced
14958:19c05cbf2811 14959:f2b5d784fa88
85 /* Number of bytes of consing since gc before another gc should be done. */ 85 /* Number of bytes of consing since gc before another gc should be done. */
86 int gc_cons_threshold; 86 int gc_cons_threshold;
87 87
88 /* Nonzero during gc */ 88 /* Nonzero during gc */
89 int gc_in_progress; 89 int gc_in_progress;
90
91 /* Nonzero means display messages at beginning and end of GC. */
92 int garbage_collection_messages;
90 93
91 #ifndef VIRT_ADDR_VARIES 94 #ifndef VIRT_ADDR_VARIES
92 extern 95 extern
93 #endif /* VIRT_ADDR_VARIES */ 96 #endif /* VIRT_ADDR_VARIES */
94 int malloc_sbrk_used; 97 int malloc_sbrk_used;
1488 } 1491 }
1489 } 1492 }
1490 } 1493 }
1491 #endif /* MAX_SAVE_STACK > 0 */ 1494 #endif /* MAX_SAVE_STACK > 0 */
1492 1495
1493 if (!noninteractive) 1496 if (garbage_collection_messages)
1494 message1_nolog ("Garbage collecting..."); 1497 message1_nolog ("Garbage collecting...");
1495 1498
1496 /* Don't keep command history around forever */ 1499 /* Don't keep command history around forever */
1497 tem = Fnthcdr (make_number (30), Vcommand_history); 1500 tem = Fnthcdr (make_number (30), Vcommand_history);
1498 if (CONSP (tem)) 1501 if (CONSP (tem))
1604 1607
1605 consing_since_gc = 0; 1608 consing_since_gc = 0;
1606 if (gc_cons_threshold < 10000) 1609 if (gc_cons_threshold < 10000)
1607 gc_cons_threshold = 10000; 1610 gc_cons_threshold = 10000;
1608 1611
1609 if (omessage || minibuf_level > 0) 1612 if (garbage_collection_messages)
1610 message2_nolog (omessage, omessage_length); 1613 {
1611 else if (!noninteractive) 1614 if (omessage || minibuf_level > 0)
1612 message1_nolog ("Garbage collecting...done"); 1615 message2_nolog (omessage, omessage_length);
1616 else
1617 message1_nolog ("Garbage collecting...done");
1618 }
1613 1619
1614 return Fcons (Fcons (make_number (total_conses), 1620 return Fcons (Fcons (make_number (total_conses),
1615 make_number (total_free_conses)), 1621 make_number (total_free_conses)),
1616 Fcons (Fcons (make_number (total_symbols), 1622 Fcons (Fcons (make_number (total_symbols),
1617 make_number (total_free_symbols)), 1623 make_number (total_free_symbols)),
2609 This limit is applied when garbage collection happens.\n\ 2615 This limit is applied when garbage collection happens.\n\
2610 The size is counted as the number of bytes occupied,\n\ 2616 The size is counted as the number of bytes occupied,\n\
2611 which includes both saved text and other data."); 2617 which includes both saved text and other data.");
2612 undo_strong_limit = 30000; 2618 undo_strong_limit = 30000;
2613 2619
2620 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages,
2621 "Non-nil means display messages at start and end of garbage collection.");
2622 garbage_collection_messages = 0;
2623
2614 /* We build this in advance because if we wait until we need it, we might 2624 /* We build this in advance because if we wait until we need it, we might
2615 not be able to allocate the memory to hold it. */ 2625 not be able to allocate the memory to hold it. */
2616 memory_signal_data 2626 memory_signal_data
2617 = Fcons (Qerror, Fcons (build_string ("Memory exhausted--use M-x save-some-buffers RET"), Qnil)); 2627 = Fcons (Qerror, Fcons (build_string ("Memory exhausted--use M-x save-some-buffers RET"), Qnil));
2618 staticpro (&memory_signal_data); 2628 staticpro (&memory_signal_data);