Adjust GC_requested_heapsize on GC_init if GC_INITIAL_HEAP_SIZE given
authorIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jan 2012 04:22:16 +0000 (08:22 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jan 2012 09:53:01 +0000 (13:53 +0400)
* misc.c (GC_init): Adjust GC_requested_heapsize if GC_expand_hp_inner
(called with the value passed by "GC_INITIAL_HEAP_SIZE" environment
variable) succeeded.

misc.c

diff --git a/misc.c b/misc.c
index 63545d4..0301195 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1000,6 +1000,8 @@ GC_API void GC_CALL GC_init(void)
     if (!GC_expand_hp_inner(initial_heap_sz)) {
         GC_err_printf("Can't start up: not enough memory\n");
         EXIT();
+    } else {
+        GC_requested_heapsize += initial_heap_sz;
     }
     if (GC_all_interior_pointers)
       GC_initialize_offsets();