aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorRichard M. Stallman1996-11-07 21:14:18 +0000
committerRichard M. Stallman1996-11-07 21:14:18 +0000
commit0f936def561bba7b7f6db9e1d51a1051f900c0db (patch)
tree5ce2e2599bacf077784fed3839d534c171d88b33 /src/alloc.c
parent9abbd16515cbbbc3cf065ca31663e9fc05e7aa18 (diff)
downloademacs-0f936def561bba7b7f6db9e1d51a1051f900c0db.tar.gz
emacs-0f936def561bba7b7f6db9e1d51a1051f900c0db.zip
(Fgarbage_collect): Use Vhistory_length for truncating Vcommand_history.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 7f3dbbec27f..ad7e6beb4a3 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -48,6 +48,8 @@ extern char *sbrk ();
48extern __malloc_size_t _bytes_used; 48extern __malloc_size_t _bytes_used;
49extern int __malloc_extra_blocks; 49extern int __malloc_extra_blocks;
50 50
51extern Lisp_Object Vhistory_length;
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
@@ -1497,10 +1499,13 @@ Garbage collection happens automatically if you cons more than\n\
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 {