summaryrefslogtreecommitdiff
path: root/src/gc/gc.h
AgeCommit message (Collapse)AuthorFilesLines
2019-04-15Delete unused YieldProcessorScalingFactor from GC (#23994)Jan Kotas1-2/+0
2019-02-22Enable FEATURE_BASICFREEZE (#22776)Mukul Sabharwal1-7/+0
2018-12-26desktop port (#21523)Maoni Stephens1-0/+3
+alloc lock split into SOH and LOH +provisional mode to fix too many gen2 GCs triggered in low mem situation when the heap has heavy pinning fragmentation +better free list usage +premature OOM fixes +3 new configs: GCHeapAffinitizeMask, GCHighMemPercent, GCLOHThreshold (will be documented) YieldProcessor scaling factor is different on core due to the different implementation on core.
2018-04-02[local gc] gc spinning part 1 (#17341)David Mason1-0/+2
Add an api so the VM can tell the GC how long to spin for to normalize across processor families.
2018-03-13[local gc] refactor apis for threading and suspension to avoid redundant ↵David Mason1-0/+2
calls in to the runtime (#16765) * [Local GC] Refactor calls involving thread modes, suspension, and alloc contexts to always operate on current thread * BOOL -> bool for enable/disable preemptive routines, also remove an unused call to GetThread * avoid one indirection by having GCToEEInterface::EnablePreemptiveGC return a bool indicating whether the mode was changed * Callback on IGCHeap for the runtime to notify the GC when it is trapping threads * use g_fSuspensionPending instead of GCToEEInterface::CatchAtSafePoint for allow_fgc * Remove CatchAtSafePoint * Remove GetThread from WaitLongerNoInstru * code review feedback * code review feedback * change BOOL to bool
2018-01-31[local gc] Enable eventing (#16120)David Mason1-0/+6
* move GC etw enums to gcinterface.ee.h * add GetActiveSyncBlockCount * refactor reference to ETW::GCLog::ShouldTrackMovementForEtw() * mov g_dwHandles to gc side * enable FEATURE_EVENT_TRACE for gc
2018-01-30[Local GC] FEATURE_EVENT_TRACE 4/n: Event ports for all GC-keyword events ↵Sean Gillespie1-0/+23
(#16031) * [Local GC] Event ports: GCStart and GCGenerationRange * [Local GC] Event ports: GCEnd * [Local GC] Event ports: GCHeapStats * [Local GC] Event ports: GCCreateSegment * [Local GC] Event ports: GCFreeSegment * Event ports: GCCreateConcurrentThread and GCTerminateConcurrentThread * [Local GC] Event ports: GCTriggered * [Local GC] Event ports: GCMarkWithType * [Local GC] Event ports: GCJoin_V2 * [Local GC] Event ports: GCGlobalHeapHistory_V2 * [Local GC] Event ports: GCAllocationTick_V3 * [Local GC] Event ports: GCAllocationTick_V1 * [Local GC] Event porting: PinObjectAtGCTime * one last merge conflict
2017-08-22[Local GC] Enable building the GC as a shared library (#13137)Sean Gillespie1-5/+0
* [Local GC] Build the GC using system headers * Disable features to get the GC to build * Get rid of the separate 'GC PAL' build * Remove unused stuff * Don't build gcenv.os.cpp when linking in a standalone gc * Stub out CPUGroupInfo and NumaNodeInfo * Stub out IsGCThread and friends * Build the GC as a shared library :tada: * Build, link, and run! :tada: * Fix standalone GC build break * Fixes where the GC's MethodTable and VM's MethodTable classes disagree * Integrate a standalone GC into the CoreCLR build system (so it gets copied to the output folder). Re-enable some ifdef-ed out includes that are required for a non-standalone build of the GC. * Bring changes to Unix and fix the Unix build. Implement some compiler intrinsic wrappers and alignment functions expected by the GC. * Fix the Windows build * 1. Code review feedback: use standard types for BitScanForward and BitScanForward64 2. Delete FEATURE_COM stuff from the build system, not needed for this PR 3. Fix the Unix build * Fix the Windows x86 build - the _BitScanForward64 intrinsic is not available when targeting 32-bit platforms * Remove a number of things from gcenv.base.h that are not used * Remove a linker workaround now that we are not linking a standalone GC into the runtime * Remove dead code, make the lack of GC_PROFILING for standalone gc not break profiling on the non-standalone build * Code review feedback - use add_library_clr and other cmake-related fixes * Fix include indentation * Remove some extraneous parameters to cmake functions (cmake is remarkably lenient...)
2017-07-20[Local GC] Refactor usage of GC-internal functions in the DAC (#12458)Sean Gillespie1-0/+2
* Refactor usage of GC-internal functions in the DAC * Fix one debugger test failure, one to go
2017-06-12[Arm64/Unix] Add 64K page support (#10981)Steve MacLean1-11/+0
* [Arm64/Unix] Support 64K pages * GC move GCToOSInterface::Initialize() into InitializeGarbageCollector()
2017-06-01[Local GC] Remove uses of g_SystemInfo from the GC (#11628)Sean Gillespie1-0/+1
* [Local GC] Don't use g_SystemInfo to infer the number of processors * [Local GC] Avoid using g_SystemInfo.dwAllocationGranularity from within the GC. In a few places, the GC aligns the size of a request memory reservation to the allocation granularity before calling GCToOSInterface::VirtualReserve. Upon inspection, this isn't necessary. * [Local GC] Remove uses of g_SystemInfo from the handle table * Add new API on GCToOSInterface for querying the total number of procs on the machine
2017-06-01[Local GC] Obtaining configuration information (#11379)Sean Gillespie1-0/+1
* [Local GC] Skeleton for GC configuration * Initial tweaks after design feedback: 1) Use string keys instead of enums. Upon receiving a string key, the EE looks at it and, if it's something that comes from startup flags, responds using the startup flag information. Otherwise, it forwards the string onto CLRConfig. 2) Add a mechanism for getting string configuration values from the EE. This includes adding a RAII wrapper around strings so that they are freed correctly. * Remove uses of g_pConfig from the GC and replace with GCConfig * Use the GCConfig system for the GC log * Fix poorly-named parameter * Add documentation and caching of bool and int configs obtained from the EE * Remove AppDomainLeaks as dead code * Remove GC trace configs as dead code * Repair unix build * Fix an issue where we started the GC in the wrong latency mode * Fix the unix build * Pipe GCRetainVM configuration to the GC * Dead code removal in the GC sample * EEConfig -> GCConfig for heap verification constants in the GC * Populate config information for bools and ints eagerly at startup * Initialize g_theGCToCLR before initializing GCConfig * Propegate HoardVM config to the GC * Fix an incorrect comment
2017-06-01[Local GC] Scaffolding for loading a standalone GC (#11242)Sean Gillespie1-3/+4
* Configure the build system to build a CoreCLR capable of loading a standalone GC * Proto-implementation of dynamic GC loading * Build the GC with the VM's CMakeLists when doing a non-standalone build of the GC * [Local GC] Introduce a new feature define, FEATURE_STANDALONE_GC_ONLY, to be used by the CI to explicitly test local GC dynamic loading code paths * Fix the FEATURE_STANDALONE_GC_ONLY build for unix linkers * Rebase against master * Code review feedback: use the existing Unix exports file
2017-04-13Rename IGCHandleTable to IGCHandleManager.Aditya Mandaleeka1-3/+3
2017-04-09[Local GC] Move knowledge of the free object method table outside of the GC ↵Sean Gillespie1-0/+1
(#10755) * [Local GC] Move knowledge of the free object method table outside of the GC * Revert "[Local GC] Move knowledge of the free object method table outside of the GC" This reverts commit 02979e5eb12dd44edb2603e16411dd7d7ffc377d. * Address code review feedback: leave ArrayBase alone, as it should be part of the binary contract between the EE and the GC * Correct a bad merge
2017-04-05[Local GC] Move Weak Reference finalization out of the GC (#10676)Sean Gillespie1-6/+0
* [Local GC] Move Weak Reference finalization out of the GC * Address two issues: 1) Use GetGCSafeMethodTable instead of GetMethodTable, so that the mark bit is correctly masked off the object's method table pointer, 2) Address code review feedback by re-inserting a missed call to GetCanonicalMethodTable and rename the new API to EagerFinalized to better illustrate its broader purpose. * Repair the GC sample
2017-04-01[Local GC] Remove static fields from GC interface (#10566)Sean Gillespie1-8/+6
* Remove max_generation from GC interface * [Local GC] Clean up the GC interface by removing all static fields from it: 1) gcHeapType is replaced by g_heap_type (EE side) and g_gc_heap_type (GC side), each of which is set on initialization. g_heap_type is read by the DAC to determine what kind of heap is being used. 2) maxGeneration is not necessary due to the GC DAC changes. * Rebase against master * Comments and cleanup * Use a heap allocation instead of alloca * Code review feedback: remove a redundant cast and allocate generation count table once, on first use * Address code review feedback: cache some calls to GetMaxGeneration
2017-03-29Create a GCHandleTable interface with Init/Shutdown.Aditya Mandaleeka1-0/+5
2017-03-28[Local GC] Use standard C++ types (bool) and consistent types (void*) on the ↵Sean Gillespie1-4/+4
interface (#10463) * [Local GC] BOOL -> bool on IGCHeap * [Local GC] size_t -> void* on IGCHeap * [Local GC] Silence warnings by being explicit about BOOl -> bool conversions * Address code review feedback: FinalizeAppDomain BOOL -> bool * Fix warnings * Address code review feedback: 1) Fix a missed default parameter (FALSE) on a parameter of type bool, 2) Fix invocations of the diagnostic callbacks to use boolean literals instead of TRUE and FALSE, 3) Fix various invocations of GC interface methods in the VM to use boolean literals instead of TRUE and FALSE * Address code review feedback: fix inconsistency
2017-03-22Opt-out of GC Stress for FEATURE_STANDALONE_GC (#10391)Sean Gillespie1-0/+5
2017-03-16[Local GC] Break EE dependency on GC's generation table and alloc lock in ↵Sean Gillespie1-8/+0
single-proc scenarios (#10065) * Remove usage of the generation table from the EE by introducing an EE-owned GC alloc context used for allocations on single-proc machines. * Move the GC alloc lock to the EE side of the interface * Repair the Windows ARM build * Move the decision to use per-thread alloc contexts to the EE * Rename the lock used by StartNoGCRegion and EndNoGCRegion to be more indicative of what it is protecting * Address code review feedback 2 (enumerate the global alloc context as a part of GCToEEInterface) * Code review feedback (3) * Address code review feedback (move some GC-internal globals to gcimpl.h and gc.cpp) * g_global_alloc_lock is a dword, not a qword - fixes a deadlock * Move GlobalAllocLock to gchelpers.cpp and switch to preemptive mode when spinning * Repair the Windows x86 build
2017-03-01Merge pull request #9770 from adityamandaleeka/card_bundles_unix_2Aditya Mandaleeka1-0/+4
Implement second-level card tables for non-Windows platforms
2017-02-28Implement card bundles for non-Windows platforms.Aditya Mandaleeka1-0/+4
2017-02-24[Local GC] Move workstation GC DAC globals to a struct shared between GC and ↵Sean Gillespie1-40/+3
DAC (#9255) * [Local GC] Move workstation GC DAC globals to a struct shared between the GC and the DAC * (Some) code review feedback and bug fixes for issues found while debugging on OSX * Address some code review feedback: 1. Make g_gcDacGlobals a pointer and dacvar on the VM side, so that publishing the GC dac vars is done atomically (through a pointer assignment). This fixes a race that Noah noticed. 2. Remove the requirement for the GC's generation class struct to be known at compile-time, by using a dacvar as the size of the generation class at run-time (for pointer arithmetic) 3. Move all DAC-interesting fields to be at the start of GC internal classes, so that the DAC does not need to know the size or exact layout of the class past the fields it cares about. * Split the definition of the size of several arrays across the SOS/DAC and GC/DAC interfaces, and add static asserts that they are the same * Repair the Windows Release build * Implement the GC DAC scheme for Server GC and eliminate the duplicate GC dac vars * Some work * Decouple use of the GC generation table from a write barrier by having the EE store a copy of the global during initialization * Actually make it work with server GC * Checkpoint * Checkpoint where everything works * Code cleanup * Fix debugger test failures * Additional code cleanup * Address code review feedback by adding a static assert and standardizing the way that we iterate over the generation table * Repair the Windows x86 build * Revert "Decouple use of the GC generation table from a write barrier by having the EE store a copy of the global during initialization" This reverts commit 573f61a16b4fa8c2fc4c568c0b968a921230f31c. * Revert "Repair the Windows x86 build" This reverts commit 188c22d87e1d65abf00ab8fa28f46ad607a9028f. * Partial revert, move `generation_table` back the global namespace for a single-proc allocation helper * Fix a debugger test failure * Repair crash dump scenarios
2017-01-23[Local GC] Add three finalization-related operations to GCToEEInterface (#9029)Sean Gillespie1-0/+6
* Add three finalization-related operations to GCToEEInterface and utilize them from the GC * Code review feedback * Code review feedback * Fix standalone GC build break * Repair the standalone GC build
2017-01-06[Local GC] Move Software Write Watch's write barrier updates to ↵Sean Gillespie1-2/+0
GCToEEInterface::StompWriteBarrier (#8605) * Move Software Write Watch's write barrier updates to use the new GCToEEInterface::StompWriteBarrier to stomp the EE's write barrier. * Address code review feedback, move SetCardsAfterBulkCopy to EE side of the interface
2016-12-10Local GC: Decouple write barrier operations between the GC and EE (#8568)Sean Gillespie1-0/+6
* Decouple write barrier operations between the GC and EE * Address code review feedback * Address code review feedback * Repair the standalone GC build
2016-11-16Enable GCToOSInterface to be defined on the GC side of the GC interface (#8121)Sean Gillespie1-0/+12
* Re-introduce changes lost in a merge conflict * Enable GCToOSInterface to be defined behind the GC interface when building the GC in standalone mode. Provide a skeleton Windows implementation and the framework for a Unix implementation. * Address code review feedback
2016-10-06Restore some changes lost in a merge conflict (#7512)Sean Gillespie1-0/+4
2016-09-28Add option to measure time spent inside calls to the CLR. (#7357)Peter Kukol1-4/+0
* Add option to measure time spent inside calls to the CLR (off by default).
2016-09-26Introduce "IGCToCLR" and use it within the GC to interface with the EE (#7295)Sean Gillespie1-0/+4
* Introduce a feature define FEATURE_STANDALONE_GC that allows the GC to communicate with the EE through a virtual interface. * Split GCToEEInterface definition out of gc.h into its own header * Address code review feedback * Address code review feedback
2016-09-15Update the GC from CoreRT (#7207)Sean Gillespie1-23/+2
2016-09-08Fix a build break introduced by GH#6764dotnet-bot1-1/+0
[tfs-changeset: 1626397]
2016-09-08Introduce an interface separating the GC and the VM,Sean Gillespie1-447/+84
modifying the VM to utilize this interface. Introduce an interface separating the GC and the rest of the VM Remove static members of both IGCHeap and IGCHeapInternal and move the management of the singular GC heap to the VM. Rename uses of IGCHeap in the VM to GCHeapHolder, as well as other misc. renames throughout the VM and GC. Split each interface function into categories, document them, use consistent formatting across the interface Undo some accidental find/replace collateral damage Remove all ifdefs from the GC interface Deduplicate function declarations between IGCHeap and IGCHeapInternal, expose AllocAlign8 through the interface and the reference to alloc_context to repair the ARM build Paper cut: false -> nullptr Repair the ARM and x86 builds Rename GCHeapHolder -> GCHeapUtilities and address documentation feedback Rebase against master Rename gcholder.h/cpp -> gcheaputilities.h/cpp Fix an uninitialized field on alloc_context causing test failures on clang Rename the include guard for gcheaputilities.h Un-breaks SOS by making the following changes: 1) Instructs the DAC to look for IGCHeap::gcHeapType by name, instead of assuming that it exists near g_pGCHeap, 2) Eliminate all virtual calls on IGCHeap in the DAC, since we cannot dispatch on an object in another process, 3) Because of 2, expose the number of generations past the GC interface using a static variable on IGCHeap that the DAC can read directly. repair the Windows build
2016-06-23Fix GC profiling on arm-softfp (#5952)Ivan Baravy1-2/+2
This commit updates one preprocessor directive inside gc.h to initialize dwEtwRootKind field of ScanContext when GC_PROFILING is defined while FEATURE_EVENT_TRACE is not. This happens to platforms like arm-softfp.
2016-03-09Delete dead codeJan Kotas1-12/+0
- Delete BINDER, STANDALONE_BINDER and MDIL ifdefs
2016-02-24Update GC from CoreRTJan Kotas1-3/+3
https://github.com/dotnet/corert/tree/master/src/Native/gc d18f7e5d9fea784b4531aa8988fdad9f3a9cffc3
2016-01-27Update license headersdotnet-bot1-4/+3
2016-01-08Fix issue with unlimited stack settingJan Vorlicek1-0/+2
This change fixes a problem when a process stack size is set to unlimited. In such case, the main thread stack memory range can shrink during the process run time. But CoreCLR caches the initial stack limit value and uses it to detect whether an object is on stack. Since the stack range is not correct and there can be allocations in the original range of the stack, this check sometimes fails and can cause issues. The fix is to remember the stack top at the beginning of the scan in the ScanContext and use it to check the object address too.
2015-12-16Update GC from CoreRTJan Kotas1-0/+6
https://github.com/dotnet/corert/tree/master/src/Native/gc e223e35867c4660fe8423fedb2e547152dd7fd2d
2015-12-16Rename CNameSpace to GCScanJan Kotas1-1/+1
2015-11-19Update GC from CoreRTJan Kotas1-0/+4
https://github.com/dotnet/corert/tree/master/src/Native/gc c03d823a11f54e734e340813e6cd1e543ca448ef
2015-11-19Changed LONG and ULONGJan Vorlicek1-2/+2
2015-11-18Replace most windows style types by c++ typesJan Vorlicek1-30/+30
This change replaces DWORD, LONGLONG, ULONGLONG, SIZE_T, BYTE, LONG32 and few more by standard c++ types. The DWORD still remains present in signatures of Windows APIs used by the GC. There are few issues with those that need to get fixed.
2015-10-29Port .NET Framework 4.6.1 changesJan Kotas1-6/+19
Core runtime and GC changes from https://github.com/Microsoft/dotnet/blob/master/docs/releases/net461/dotnet461-changes.md that are not in CoreCLR yet [tfs-changeset: 1543382]
2015-10-15Cleanup GC-EE InterfaceJan Kotas1-7/+1
- Add proper abstractions for threading methods to GCToEEInterface - Split sample gcenv into multiple files to avoid redundant content - Add handle table methods needed by .NET Native WinRT implementation Part of #1550
2015-10-09Add allocation fast path for arrays of value type elements outside WindowsKoundinya Veluri1-3/+4
- A microbenchmark involving byte array allocation was about 200% faster on Windows compared to Linux - On Windows, using the portable version of the fast path is about 5% slower than using the asm version on the microbenchmark - On Linux, using the portable fast path improves the microbenchmark perf by 160% - With the fast path enabled on Linux, the microbenchmark on Windows (with asm fast path) is now about 17% faster than on Linux.
2015-09-12Replace unsigned __int64/__int64 with UINT64/INT64Jan Kotas1-2/+2
2015-05-26Fix the virtual destructor warningJan Vorlicek1-0/+3
This change changes destructors to be virtual or adds virtual ones where they were missing based on the clang warnings.
2015-03-06Add a fourth parameter to the DEFINE_DACVAR macro that is the actual fully ↵Mike McLaughlin1-0/+1
qualified name of the static/global. First pass at the global DAC table support for Linux. Explicitly build the table in the coreclr module instead of extract it from the pdb and put it in a resource. Fixed the SVR gc globals in the DAC table. They had to be seperated and initialized in gceesvr.cpp. Start on global pointer table. PAL functions to write and read the DAC table address between processes. The dac table is now copied from the coreclr process to the DAC/debugger process. The tables were not being built with exactly the same defines so they weren't the same size. Fixed a bug in the read memory implementation. Still assumes pid = 0. Changed the dacTable entries to be RVAs and renabled getting the corclr module base addres (m_globalBase). Added dac table address file cleanup on coreclr shutdown. Filled in the vtable entries in the global dac table. Changed some of the VPTR_* macros to be defined on the coreclr side (RS) to defined a constructor that is used to get the vtable in dactable.cpp. These changes required default constructors to be added to some of the classes. Changed getting the vtable address to not invoke the destructors since the constructor used didn't do anything (like initialize variables, etc.). Added a TODO comment about the debuggee pid not being available in the dac table address file name. Fixed Windows build. Created a couple of new VPTR_* macros that add a default constructor only if building coreclr (not DAC) on Linux. Comment on how these DAC table functions are temporary.