From: Maoni Stephens Date: Thu, 2 Jul 2020 19:21:49 +0000 (-0700) Subject: Trivial fix and renaming (#38687) X-Git-Tag: submit/tizen/20210909.063632~6969 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8126962457be677cb8b9313d5d9f26849da77df2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Trivial fix and renaming (#38687) + When allocating in UOH free list we should do >= (min_obj_size) instead of >. + Renamed loh_a_fit_segment_end_p to uoh_a_fit_segment_end_p (should have been part of the refactoring work) --- diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index e217e48..17bb011 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -12195,7 +12195,7 @@ BOOL gc_heap::a_fit_free_list_uoh_p (size_t size, #endif //FEATURE_LOH_COMPACTION // must fit exactly or leave formattable space - if ((diff == 0) || (diff > (ptrdiff_t)Align (min_obj_size, align_const))) + if ((diff == 0) || (diff >= (ptrdiff_t)Align (min_obj_size, align_const))) { #ifdef BACKGROUND_GC cookie = bgc_alloc_lock->uoh_alloc_set (free_list); @@ -12407,7 +12407,7 @@ found_no_fit: return FALSE; } -BOOL gc_heap::loh_a_fit_segment_end_p (int gen_number, +BOOL gc_heap::uoh_a_fit_segment_end_p (int gen_number, size_t size, alloc_context* acontext, uint32_t flags, @@ -12974,7 +12974,7 @@ BOOL gc_heap::uoh_try_fit (int gen_number, if (!a_fit_free_list_uoh_p (size, acontext, flags, align_const, gen_number)) { - can_allocate = loh_a_fit_segment_end_p (gen_number, size, + can_allocate = uoh_a_fit_segment_end_p (gen_number, size, acontext, flags, align_const, commit_failed_p, oom_r); diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 2609495..7e2f7bb 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -1567,7 +1567,7 @@ protected: int align_const, BOOL* commit_failed_p); PER_HEAP - BOOL loh_a_fit_segment_end_p (int gen_number, + BOOL uoh_a_fit_segment_end_p (int gen_number, size_t size, alloc_context* acontext, uint32_t flags,