Added new API mono_runtime_set_main_args() and fixed CommandLine for embedders.
[mono.git] / mono / metadata / sgen-memory-governor.c
index 96cb905011585634774180a7a0c3c4529010ced3..7cc97ee45bf7b961206d7a2da48d51be713a28c1 100644 (file)
@@ -139,11 +139,11 @@ sgen_memgov_try_calculate_minor_collection_allowance (gboolean overwrite)
        if (debug_print_allowance) {
                mword old_major = last_collection_old_num_major_sections * major_collector.section_size;
 
-               SGEN_LOG (1, "Before collection: %td bytes (%td major, %td LOS)",
-                               old_major + last_collection_old_los_memory_usage, old_major, last_collection_old_los_memory_usage);
-               SGEN_LOG (1, "After collection: %td bytes (%td major, %td LOS)",
-                               new_heap_size, new_major, last_collection_los_memory_usage);
-               SGEN_LOG (1, "Allowance: %td bytes", minor_collection_allowance);
+               SGEN_LOG (1, "Before collection: %ld bytes (%ld major, %ld LOS)",
+                                 (long)(old_major + last_collection_old_los_memory_usage), (long)old_major, (long)last_collection_old_los_memory_usage);
+               SGEN_LOG (1, "After collection: %ld bytes (%ld major, %ld LOS)",
+                                 (long)new_heap_size, (long)new_major, (long)last_collection_los_memory_usage);
+               SGEN_LOG (1, "Allowance: %ld bytes", (long)minor_collection_allowance);
        }
 
        if (major_collector.have_computed_minor_collection_allowance)
@@ -390,6 +390,7 @@ sgen_memgov_init (glong max_heap, glong soft_limit, gboolean debug_allowance, do
                soft_heap_limit = soft_limit;
 
        debug_print_allowance = debug_allowance;
+       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
 
        if (max_heap == 0)
                return;
@@ -405,13 +406,12 @@ sgen_memgov_init (glong max_heap, glong soft_limit, gboolean debug_allowance, do
        }
        max_heap_size = max_heap - sgen_nursery_size;
 
-       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
-
        if (allowance_ratio)
                default_allowance_nursery_size_ratio = allowance_ratio;
 
        if (save_target)
                save_target_ratio = save_target;
+       minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
 }
 
 #endif