diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-07-23 07:23:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-23 07:23:21 -0700 |
commit | 087e750df2a13801d0f144cdcfa6c1c3e16067c2 (patch) | |
tree | 557b34c3e18b801e410f45d1a2c9c64924520baf /src/gc/gc.cpp | |
parent | ac01e272bbbf6ce03f69843326d7fdfc74df245a (diff) | |
download | coreclr-087e750df2a13801d0f144cdcfa6c1c3e16067c2.tar.gz coreclr-087e750df2a13801d0f144cdcfa6c1c3e16067c2.tar.bz2 coreclr-087e750df2a13801d0f144cdcfa6c1c3e16067c2.zip |
GC update from CoreRT (#6429)
https://github.com/dotnet/corert/tree/master/src/Native/gc 91d7a9c8e2b393314422b6106adedec683c0ae51
Diffstat (limited to 'src/gc/gc.cpp')
-rw-r--r-- | src/gc/gc.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index af2d1e7915..33004211e2 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -2271,7 +2271,7 @@ SPTR_IMPL_NS(PTR_gc_heap, SVR, gc_heap, g_heaps); size_t* gc_heap::g_promoted; #ifdef MH_SC_MARK -BOOL* gc_heap::g_mark_stack_busy; +int* gc_heap::g_mark_stack_busy; #endif //MH_SC_MARK @@ -4921,7 +4921,7 @@ public: return TRUE; } - static void init_cpu_mapping(gc_heap *heap, int heap_number) + static void init_cpu_mapping(gc_heap * /*heap*/, int heap_number) { if (GCToOSInterface::CanGetCurrentProcessorNumber()) { @@ -4942,8 +4942,10 @@ public: sniff_buffer[(1 + heap_number*n_sniff_buffers + sniff_index)*HS_CACHE_LINE_SIZE] &= 1; } - static int select_heap(alloc_context* acontext, int hint) + static int select_heap(alloc_context* acontext, int /*hint*/) { + UNREFERENCED_PARAMETER(acontext); // only referenced by dprintf + if (GCToOSInterface::CanGetCurrentProcessorNumber()) return proc_no_to_heap_no[GCToOSInterface::GetCurrentProcessorNumber() % gc_heap::n_heaps]; @@ -5103,7 +5105,7 @@ void gc_heap::destroy_thread_support () } } -#if !defined(FEATURE_REDHAWK) && !defined(FEATURE_PAL) +#if !defined(FEATURE_PAL) void set_thread_group_affinity_for_heap(int heap_number, GCThreadAffinity* affinity) { affinity->Group = GCThreadAffinity::None; @@ -5183,7 +5185,7 @@ void set_thread_affinity_mask_for_heap(int heap_number, GCThreadAffinity* affini } } } -#endif // !FEATURE_REDHAWK && !FEATURE_CORECLR +#endif // !FEATURE_PAL bool gc_heap::create_gc_thread () { @@ -5193,7 +5195,7 @@ bool gc_heap::create_gc_thread () affinity.Group = GCThreadAffinity::None; affinity.Processor = GCThreadAffinity::None; -#if !defined(FEATURE_REDHAWK) && !defined(FEATURE_PAL) +#if !defined(FEATURE_PAL) if (!gc_thread_no_affinitize_p) { //We are about to set affinity for GC threads, it is a good place to setup NUMA and @@ -5204,7 +5206,7 @@ bool gc_heap::create_gc_thread () else set_thread_affinity_mask_for_heap(heap_number, &affinity); } -#endif // !FEATURE_REDHAWK && !FEATURE_PAL +#endif // !FEATURE_PAL return GCToOSInterface::CreateThread(gc_thread_stub, this, &affinity); } @@ -13179,7 +13181,7 @@ try_again: org_hp->alloc_context_count--; max_hp->alloc_context_count++; acontext->alloc_heap = GCHeap::GetHeap(max_hp->heap_number); -#if !defined(FEATURE_REDHAWK) && !defined(FEATURE_PAL) +#if !defined(FEATURE_PAL) if (CPUGroupInfo::CanEnableGCCPUGroups()) { //only set ideal processor when max_hp and org_hp are in the same cpu //group. DO NOT MOVE THREADS ACROSS CPU GROUPS @@ -13213,7 +13215,7 @@ try_again: org_hp->heap_number)); } } -#endif // !FEATURE_REDHAWK && !FEATURE_PAL +#endif // !FEATURE_PAL dprintf (3, ("Switching context %p (home heap %d) ", acontext, acontext->home_heap->pGenGCHeap->heap_number)); @@ -13232,7 +13234,7 @@ try_again: acontext->alloc_count++; } -gc_heap* gc_heap::balance_heaps_loh (alloc_context* acontext, size_t size) +gc_heap* gc_heap::balance_heaps_loh (alloc_context* acontext, size_t /*size*/) { gc_heap* org_hp = acontext->alloc_heap->pGenGCHeap; //dprintf (1, ("LA: %Id", size)); @@ -17762,8 +17764,8 @@ gc_heap::mark_steal() if (((size_t)o > 4) && !partial_object_p (o)) { //this is a normal object, not a partial mark tuple - //success = (FastInterlockCompareExchangePointer (&ref_mark_stack (hp, level), 0, o)==o); - success = (FastInterlockCompareExchangePointer (&ref_mark_stack (hp, level), 4, o)==o); + //success = (Interlocked::CompareExchangePointer (&ref_mark_stack (hp, level), 0, o)==o); + success = (Interlocked::CompareExchangePointer (&ref_mark_stack (hp, level), (uint8_t*)4, o)==o); #ifdef SNOOP_STATS snoop_stat.interlocked_count++; if (success) @@ -17798,7 +17800,7 @@ gc_heap::mark_steal() if (o && start) { //steal the object - success = (FastInterlockCompareExchangePointer (&ref_mark_stack (hp, level+1), stolen, next)==next); + success = (Interlocked::CompareExchangePointer (&ref_mark_stack (hp, level+1), (uint8_t*)stolen, next)==next); #ifdef SNOOP_STATS snoop_stat.interlocked_count++; if (success) @@ -23303,13 +23305,8 @@ uint8_t* tree_search (uint8_t* tree, uint8_t* old_address) #ifdef FEATURE_BASICFREEZE bool gc_heap::frozen_object_p (Object* obj) { -#ifdef MULTIPLE_HEAPS - ptrdiff_t delta = 0; - heap_segment* pSegment = segment_of ((uint8_t*)obj, delta); -#else //MULTIPLE_HEAPS heap_segment* pSegment = gc_heap::find_segment ((uint8_t*)obj, FALSE); _ASSERTE(pSegment); -#endif //MULTIPLE_HEAPS return heap_segment_read_only_p(pSegment); } @@ -23326,6 +23323,7 @@ void gc_heap::relocate_address (uint8_t** pold_address THREAD_NUMBER_DCL) if (!((old_address >= gc_low) && (old_address < gc_high))) #ifdef MULTIPLE_HEAPS { + UNREFERENCED_PARAMETER(thread); if (old_address == 0) return; gc_heap* hp = heap_of (old_address); @@ -35426,7 +35424,7 @@ int GCHeap::GetHomeHeapNumber () { if (pThread) { - GCHeap *hp = pThread->GetAllocContext()->home_heap; + GCHeap *hp = GCToEEInterface::GetAllocContext(pThread)->home_heap; if (hp == gc_heap::g_heaps[i]->vm_heap) return i; } } |