summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-08-27 14:18:44 +0200
committerAndy Wingo <wingo@pobox.com>2020-08-27 14:18:44 +0200
commit837580587ba8dfab22ad74e3b4c062df00ca7422 (patch)
treecf89727f467db8b13d16af17a6bd32cec726941e
parentfdea77d01cab48a371606c7d8db6146cb17e25e5 (diff)
downloadguile-837580587ba8dfab22ad74e3b4c062df00ca7422.tar.gz
Tweak to initial heap size selection
* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): Bump a bit farther (2 MB on 64-bit, 1 MB on 32-bit) as we now expand to this size instead of expanding by this amount. (scm_storage_prehistory): Expand to the initial heap size instead of expanding by the size.
-rw-r--r--libguile/gc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libguile/gc.c b/libguile/gc.c
index 0fcce32c3..7717e9bef 100644
--- a/libguile/gc.c
+++ b/libguile/gc.c
@@ -68,7 +68,7 @@
result of 'guile -c "(display (assq-ref (gc-stats)
'heap-total-allocated))"'. */
-#define DEFAULT_INITIAL_HEAP_SIZE (200 * 1024 * SIZEOF_UINTPTR_T)
+#define DEFAULT_INITIAL_HEAP_SIZE (256 * 1024 * SIZEOF_UINTPTR_T)
/* Set this to != 0 if every cell that is accessed shall be checked:
*/
@@ -464,7 +464,9 @@ scm_storage_prehistory ()
GC_INIT ();
- GC_expand_hp (DEFAULT_INITIAL_HEAP_SIZE);
+ size_t heap_size = GC_get_heap_size ();
+ if (heap_size < DEFAULT_INITIAL_HEAP_SIZE)
+ GC_expand_hp (DEFAULT_INITIAL_HEAP_SIZE - heap_size);
/* We only need to register a displacement for those types for which the
higher bits of the type tag are used to store a pointer (that is, a