[git] CMU Common Lisp branch master updated. snapshot-2014-06-1-g0cf9036
Raymond Toy
rtoy at common-lisp.net
Tue Jun 24 04:28:57 UTC 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, master has been updated
via 0cf9036d307ffcf6690851b114607b7571706799 (commit)
from 19d7d37b313c6c252653a6f39f7fbc9c344469f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0cf9036d307ffcf6690851b114607b7571706799
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Mon Jun 23 21:26:39 2014 -0700
Change max gen to GC to 3; add inteface to set it.
* lisp/gencgc.c
* Set number of generations to GC to 3 instead of NUM_GENERATIONS -
1.
* Add simple interface to allow user to set the number of
generations and return the old value.
* code/gc.lisp:
* Add Lisp interface to set the number of generations to GC.
diff --git a/src/code/gc.lisp b/src/code/gc.lisp
index 5c200d4..b12daba 100644
--- a/src/code/gc.lisp
+++ b/src/code/gc.lisp
@@ -612,4 +612,7 @@
(gen c-call:int) (trigger-age c-call:int))
(alien:def-alien-routine set-min-mem-age c-call:void
(gen c-call:int) (min-mem-age c-call:double))
+(alien:def-alien-routine set-max-gen-to-gc c-call:unsigned-int
+ (gen c-call:int))
+
)
diff --git a/src/lisp/gencgc.c b/src/lisp/gencgc.c
index cdc95e0..cc071dd 100644
--- a/src/lisp/gencgc.c
+++ b/src/lisp/gencgc.c
@@ -594,7 +594,8 @@ struct generation_stats {
* The oldest generation that will currently be GCed by default.
* Valid values are: 0, 1, ... (NUM_GENERATIONS - 1)
*
- * The default of (NUM_GENERATIONS - 1) enables GC on all generations.
+ * A value of NUM_GENERATIONS - 1 enables GC on all generations; the
+ * default is less.
*
* Setting this to 0 effectively disables the generational nature of
* the GC. In some applications generational GC may not be useful
@@ -604,7 +605,9 @@ struct generation_stats {
* into an older generation so an unnecessary GC of this long-lived
* data can be avoided.
*/
-unsigned int gencgc_oldest_gen_to_gc = NUM_GENERATIONS - 1;
+#define DEFAULT_OLDEST_GEN_TO_GC 3
+
+unsigned int gencgc_oldest_gen_to_gc = DEFAULT_OLDEST_GEN_TO_GC;
/*
@@ -8433,3 +8436,23 @@ get_page_table_info(int page, int* flags, int* bytes)
*flags = page_table[page].flags;
*bytes = page_table[page].bytes_used;
}
+
+/*
+ * Set the oldest generation to gc to the given value. If the value
+ * is illegal, the appropriate limit is used instead. The old value
+ * is returned.
+ */
+unsigned int set_max_gen_to_gc(int gen)
+{
+ unsigned int previous = gencgc_oldest_gen_to_gc;
+
+ if (gen < 0) {
+ gencgc_oldest_gen_to_gc = 0;
+ } else if (gen >= NUM_GENERATIONS - 1) {
+ gencgc_oldest_gen_to_gc = NUM_GENERATIONS - 1;
+ } else {
+ gencgc_oldest_gen_to_gc = gen;
+ }
+
+ return previous;
+}
-----------------------------------------------------------------------
Summary of changes:
src/code/gc.lisp | 3 +++
src/lisp/gencgc.c | 27 +++++++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-cvs
mailing list