1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
8 #include "gcinterface.h"
10 #ifdef FEATURE_STANDALONE_GC
15 class GCToEEInterface : public IGCToCLR {
17 GCToEEInterface() = default;
18 ~GCToEEInterface() = default;
20 void SuspendEE(SUSPEND_REASON reason);
21 void RestartEE(bool bFinishedGC);
22 void GcScanRoots(promote_func* fn, int condemned, int max_gen, ScanContext* sc);
23 void GcStartWork(int condemned, int max_gen);
24 void AfterGcScanRoots(int condemned, int max_gen, ScanContext* sc);
25 void GcBeforeBGCSweepWork();
26 void GcDone(int condemned);
27 bool RefCountedHandleCallbacks(Object * pObject);
28 void SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, uintptr_t lp1, uintptr_t lp2);
29 void SyncBlockCacheDemote(int max_gen);
30 void SyncBlockCachePromotionsGranted(int max_gen);
31 uint32_t GetActiveSyncBlockCount();
32 bool IsPreemptiveGCDisabled();
33 bool EnablePreemptiveGC();
34 void DisablePreemptiveGC();
36 gc_alloc_context * GetAllocContext();
37 void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param);
39 // Diagnostics methods.
40 void DiagGCStart(int gen, bool isInduced);
41 void DiagUpdateGenerationBounds();
42 void DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent);
43 void DiagWalkFReachableObjects(void* gcContext);
44 void DiagWalkSurvivors(void* gcContext);
45 void DiagWalkLOHSurvivors(void* gcContext);
46 void DiagWalkBGCSurvivors(void* gcContext);
47 void StompWriteBarrier(WriteBarrierParameters* args);
49 void EnableFinalization(bool foundFinalizers);
50 void HandleFatalError(unsigned int exitCode);
51 bool ShouldFinalizeObjectForUnload(AppDomain* pDomain, Object* obj);
52 bool ForceFullGCToBeBlocking();
53 bool EagerFinalized(Object* obj);
54 MethodTable* GetFreeObjectMethodTable();
55 bool GetBooleanConfigValue(const char* key, bool* value);
56 bool GetIntConfigValue(const char* key, int64_t* value);
57 bool GetStringConfigValue(const char* key, const char** value);
58 void FreeStringConfigValue(const char* value);
60 bool WasCurrentThreadCreatedByGC();
61 bool CreateThread(void (*threadStart)(void*), void* arg, bool is_suspendable, const char* name);
62 void WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback);
63 void WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*));
64 IGCToCLREventSink* EventSink();
67 } // namespace standalone
69 #endif // FEATURE_STANDALONE_GC
71 #endif // _GCENV_EE_H_