Merge pull request #5014 from vkargov/vk-kasha
[mono.git] / mono / sgen / sgen-alloc.c
index 3b167f893814ea2375bd9236b743ed7e4a3a19d2..2e1178ad3926402057862c87b67dd792684e9026 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * sgen-alloc.c: Object allocation routines + managed allocators
+/**
+ * \file
+ * Object allocation routines + managed allocators
  *
  * Author:
  *     Paolo Molaro (lupus@ximian.com)
@@ -210,7 +211,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size)
                        /* when running in degraded mode, we continue allocing that way
                         * for a while, to decrease the number of useless nursery collections.
                         */
-                       if (degraded_mode && degraded_mode < DEFAULT_NURSERY_SIZE)
+                       if (degraded_mode && degraded_mode < sgen_nursery_size)
                                return alloc_degraded (vtable, size, FALSE);
 
                        available_in_tlab = (int)(TLAB_REAL_END - TLAB_NEXT);//We'll never have tlabs > 2Gb
@@ -240,7 +241,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size)
                                                p = (void **)sgen_nursery_alloc (size);
                                }
                                if (!p)
-                                       return alloc_degraded (vtable, size, FALSE);
+                                       return alloc_degraded (vtable, size, TRUE);
 
                                zero_tlab_if_necessary (p, size);
                        } else {
@@ -257,7 +258,7 @@ sgen_alloc_obj_nolock (GCVTable vtable, size_t size)
                                                p = (void **)sgen_nursery_alloc_range (tlab_size, size, &alloc_size);
                                }
                                if (!p)
-                                       return alloc_degraded (vtable, size, FALSE);
+                                       return alloc_degraded (vtable, size, TRUE);
 
                                /* Allocate a new TLAB from the current nursery fragment */
                                TLAB_START = (char*)p;