comparison src/alloc.c @ 16538:1e1026e6cd9d

(Fgarbage_collect): Use Vhistory_length for truncating Vcommand_history.
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 Nov 1996 21:14:18 +0000
parents 52eaaf1cc0e3
children 35f01092d865
comparison
equal deleted inserted replaced
16537:f47030b411f9 16538:1e1026e6cd9d
45 #else 45 #else
46 #define __malloc_size_t unsigned int 46 #define __malloc_size_t unsigned int
47 #endif 47 #endif
48 extern __malloc_size_t _bytes_used; 48 extern __malloc_size_t _bytes_used;
49 extern int __malloc_extra_blocks; 49 extern int __malloc_extra_blocks;
50
51 extern Lisp_Object Vhistory_length;
50 52
51 #define max(A,B) ((A) > (B) ? (A) : (B)) 53 #define max(A,B) ((A) > (B) ? (A) : (B))
52 #define min(A,B) ((A) < (B) ? (A) : (B)) 54 #define min(A,B) ((A) < (B) ? (A) : (B))
53 55
54 /* Macro to verify that storage intended for Lisp objects is not 56 /* Macro to verify that storage intended for Lisp objects is not
1495 #endif /* MAX_SAVE_STACK > 0 */ 1497 #endif /* MAX_SAVE_STACK > 0 */
1496 1498
1497 if (garbage_collection_messages) 1499 if (garbage_collection_messages)
1498 message1_nolog ("Garbage collecting..."); 1500 message1_nolog ("Garbage collecting...");
1499 1501
1500 /* Don't keep command history around forever */ 1502 /* Don't keep command history around forever. */
1501 tem = Fnthcdr (make_number (30), Vcommand_history); 1503 if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0)
1502 if (CONSP (tem)) 1504 {
1503 XCONS (tem)->cdr = Qnil; 1505 tem = Fnthcdr (Vhistory_length, Vcommand_history);
1506 if (CONSP (tem))
1507 XCONS (tem)->cdr = Qnil;
1508 }
1504 1509
1505 /* Likewise for undo information. */ 1510 /* Likewise for undo information. */
1506 { 1511 {
1507 register struct buffer *nextb = all_buffers; 1512 register struct buffer *nextb = all_buffers;
1508 1513