Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[Local GC] Add GetThread to the GC/EE interface #12036

Merged
merged 1 commit into from
Jun 8, 2017

Conversation

swgillespie
Copy link

This fixes a linker error when building the GC as a shared library.

@jkotas
Copy link
Member

jkotas commented Jun 1, 2017

It it pretty unfortunate how many GCToEEInterface indirect calls the mode flips compile into now:

Consider the following fragment - it will compile into 3 indirect calls with local GC. Instead, it can be just a single call (both GetThread and IsPreemptiveGCDisabled check can be done as part EnablePreemptiveGC):

current_thread = GCToEEInterface::GetThread(); 
cooperative_mode = gc_heap::enable_preemptive (current_thread);

I think we should make IsPreemptiveGCDisabled, EnablePreemptiveGC, DisablePreemptiveGC, GetAllocContext, CatchAtSafePoint to always operate on current thread, and get rid of the thread argument on them. They are always used on the current thread and it will be cheaper to fetch the current thread internally in these methods.

Otherwise looks good.

@swgillespie
Copy link
Author

@jkotas Thanks! Created issue https://github.com/dotnet/coreclr/issues/12043 to track that for a follow-up PR.

@swgillespie
Copy link
Author

Rebased against master to fix a merge conflict.

@swgillespie
Copy link
Author

@dotnet-bot test Tizen armel Cross Release Build
@dotnet-bot test Windows_NT x64 Debug Build and Test

@swgillespie swgillespie merged commit f1d81d2 into dotnet:master Jun 8, 2017
@swgillespie
Copy link
Author

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants