Skip to content

Commit 6f616a0

Browse files
authored
Merge branch 'dotnet:main' into main
2 parents 918bd1e + b0a476c commit 6f616a0

File tree

168 files changed

+2249
-1104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2249
-1104
lines changed

src/coreclr/gc/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ target_link_libraries(clrgc PRIVATE ${GC_LINK_LIBRARIES})
120120
install_clr(TARGETS clrgc DESTINATIONS . COMPONENT runtime)
121121

122122
add_definitions(-DBUILD_AS_STANDALONE)
123+
add_definitions(-DFEATURE_CONSERVATIVE_GC)
124+
123125
add_definitions(-DFX_VER_INTERNALNAME_STR=clrgc.dll)
124126
add_definitions(-DVERIFY_HEAP)
125127
if(CLR_CMAKE_HOST_APPLE)
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
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+
4+
namespace standalone
5+
{
6+
class GCToEEInterface : public IGCToCLR
7+
{
8+
public:
9+
GCToEEInterface() = default;
10+
~GCToEEInterface() = default;
11+
12+
void SuspendEE(SUSPEND_REASON reason)
13+
{
14+
::GCToEEInterface::SuspendEE(reason);
15+
}
16+
17+
void RestartEE(bool bFinishedGC)
18+
{
19+
::GCToEEInterface::RestartEE(bFinishedGC);
20+
}
21+
22+
void GcScanRoots(promote_func* fn, int condemned, int max_gen, ScanContext* sc)
23+
{
24+
::GCToEEInterface::GcScanRoots(fn, condemned, max_gen, sc);
25+
}
26+
27+
void GcStartWork(int condemned, int max_gen)
28+
{
29+
::GCToEEInterface::GcStartWork(condemned, max_gen);
30+
}
31+
32+
void BeforeGcScanRoots(int condemned, bool is_bgc, bool is_concurrent)
33+
{
34+
::GCToEEInterface::BeforeGcScanRoots(condemned, is_bgc, is_concurrent);
35+
}
36+
37+
void AfterGcScanRoots(int condemned, int max_gen, ScanContext* sc)
38+
{
39+
::GCToEEInterface::AfterGcScanRoots(condemned, max_gen, sc);
40+
}
41+
42+
void GcDone(int condemned)
43+
{
44+
::GCToEEInterface::GcDone(condemned);
45+
}
46+
47+
bool RefCountedHandleCallbacks(Object * pObject)
48+
{
49+
return ::GCToEEInterface::RefCountedHandleCallbacks(pObject);
50+
}
51+
52+
void SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, uintptr_t lp1, uintptr_t lp2)
53+
{
54+
::GCToEEInterface::SyncBlockCacheWeakPtrScan(scanProc, lp1, lp2);
55+
}
56+
57+
void SyncBlockCacheDemote(int max_gen)
58+
{
59+
::GCToEEInterface::SyncBlockCacheDemote(max_gen);
60+
}
61+
62+
void SyncBlockCachePromotionsGranted(int max_gen)
63+
{
64+
::GCToEEInterface::SyncBlockCachePromotionsGranted(max_gen);
65+
}
66+
67+
uint32_t GetActiveSyncBlockCount()
68+
{
69+
return ::GCToEEInterface::GetActiveSyncBlockCount();
70+
}
71+
72+
bool IsPreemptiveGCDisabled()
73+
{
74+
return ::GCToEEInterface::IsPreemptiveGCDisabled();
75+
}
76+
77+
bool EnablePreemptiveGC()
78+
{
79+
return ::GCToEEInterface::EnablePreemptiveGC();
80+
}
81+
82+
void DisablePreemptiveGC()
83+
{
84+
::GCToEEInterface::DisablePreemptiveGC();
85+
}
86+
87+
Thread* GetThread()
88+
{
89+
return ::GCToEEInterface::GetThread();
90+
}
91+
92+
gc_alloc_context * GetAllocContext()
93+
{
94+
return ::GCToEEInterface::GetAllocContext();
95+
}
96+
97+
void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param)
98+
{
99+
::GCToEEInterface::GcEnumAllocContexts(fn, param);
100+
}
101+
102+
uint8_t* GetLoaderAllocatorObjectForGC(Object* pObject)
103+
{
104+
return ::GCToEEInterface::GetLoaderAllocatorObjectForGC(pObject);
105+
}
106+
107+
void DiagGCStart(int gen, bool isInduced)
108+
{
109+
::GCToEEInterface::DiagGCStart(gen, isInduced);
110+
}
111+
112+
void DiagUpdateGenerationBounds()
113+
{
114+
::GCToEEInterface::DiagUpdateGenerationBounds();
115+
}
116+
117+
void DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent)
118+
{
119+
::GCToEEInterface::DiagGCEnd(index, gen, reason, fConcurrent);
120+
}
121+
122+
void DiagWalkFReachableObjects(void* gcContext)
123+
{
124+
::GCToEEInterface::DiagWalkFReachableObjects(gcContext);
125+
}
126+
127+
void DiagWalkSurvivors(void* gcContext, bool fCompacting)
128+
{
129+
::GCToEEInterface::DiagWalkSurvivors(gcContext, fCompacting);
130+
}
131+
132+
void DiagWalkUOHSurvivors(void* gcContext, int gen)
133+
{
134+
::GCToEEInterface::DiagWalkUOHSurvivors(gcContext, gen);
135+
}
136+
137+
void DiagWalkBGCSurvivors(void* gcContext)
138+
{
139+
::GCToEEInterface::DiagWalkBGCSurvivors(gcContext);
140+
}
141+
142+
void StompWriteBarrier(WriteBarrierParameters* args)
143+
{
144+
::GCToEEInterface::StompWriteBarrier(args);
145+
}
146+
147+
void EnableFinalization(bool gcHasWorkForFinalizerThread)
148+
{
149+
::GCToEEInterface::EnableFinalization(gcHasWorkForFinalizerThread);
150+
}
151+
152+
void HandleFatalError(unsigned int exitCode)
153+
{
154+
::GCToEEInterface::HandleFatalError(exitCode);
155+
}
156+
157+
bool EagerFinalized(Object* obj)
158+
{
159+
return ::GCToEEInterface::EagerFinalized(obj);
160+
}
161+
162+
MethodTable* GetFreeObjectMethodTable()
163+
{
164+
return ::GCToEEInterface::GetFreeObjectMethodTable();
165+
}
166+
167+
bool GetBooleanConfigValue(const char* privateKey, const char* publicKey, bool* value)
168+
{
169+
return ::GCToEEInterface::GetBooleanConfigValue(privateKey, publicKey, value);
170+
}
171+
172+
bool GetIntConfigValue(const char* privateKey, const char* publicKey, int64_t* value)
173+
{
174+
return ::GCToEEInterface::GetIntConfigValue(privateKey, publicKey, value);
175+
}
176+
177+
bool GetStringConfigValue(const char* privateKey, const char* publicKey, const char** value)
178+
{
179+
return ::GCToEEInterface::GetStringConfigValue(privateKey, publicKey, value);
180+
}
181+
182+
void FreeStringConfigValue(const char* value)
183+
{
184+
return ::GCToEEInterface::FreeStringConfigValue(value);
185+
}
186+
187+
bool IsGCThread()
188+
{
189+
return ::GCToEEInterface::IsGCThread();
190+
}
191+
192+
bool WasCurrentThreadCreatedByGC()
193+
{
194+
return ::GCToEEInterface::WasCurrentThreadCreatedByGC();
195+
}
196+
197+
bool CreateThread(void (*threadStart)(void*), void* arg, bool is_suspendable, const char* name)
198+
{
199+
return ::GCToEEInterface::CreateThread(threadStart, arg, is_suspendable, name);
200+
}
201+
202+
void WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback)
203+
{
204+
::GCToEEInterface::WalkAsyncPinnedForPromotion(object, sc, callback);
205+
}
206+
207+
void WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*))
208+
{
209+
::GCToEEInterface::WalkAsyncPinned(object, context, callback);
210+
}
211+
212+
IGCToCLREventSink* EventSink()
213+
{
214+
return ::GCToEEInterface::EventSink();
215+
}
216+
217+
uint32_t GetTotalNumSizedRefHandles()
218+
{
219+
return ::GCToEEInterface::GetTotalNumSizedRefHandles();
220+
}
221+
222+
bool AnalyzeSurvivorsRequested(int condemnedGeneration)
223+
{
224+
return ::GCToEEInterface::AnalyzeSurvivorsRequested(condemnedGeneration);
225+
}
226+
227+
void AnalyzeSurvivorsFinished(size_t gcIndex, int condemnedGeneration, uint64_t promoted_bytes, void (*reportGenerationBounds)())
228+
{
229+
::GCToEEInterface::AnalyzeSurvivorsFinished(gcIndex, condemnedGeneration, promoted_bytes, reportGenerationBounds);
230+
}
231+
232+
void VerifySyncTableEntry()
233+
{
234+
::GCToEEInterface::VerifySyncTableEntry();
235+
}
236+
237+
void UpdateGCEventStatus(int publicLevel, int publicKeywords, int privateLevel, int privateKeywords)
238+
{
239+
::GCToEEInterface::UpdateGCEventStatus(publicLevel, publicKeywords, privateLevel, privateKeywords);
240+
}
241+
242+
void LogStressMsg(unsigned level, unsigned facility, const StressLogMsg& msg)
243+
{
244+
::GCToEEInterface::LogStressMsg(level, facility, msg);
245+
}
246+
247+
uint32_t GetCurrentProcessCpuCount()
248+
{
249+
return ::GCToEEInterface::GetCurrentProcessCpuCount();
250+
}
251+
252+
void DiagAddNewRegion(int generation, BYTE * rangeStart, BYTE * rangeEnd, BYTE * rangeEndReserved)
253+
{
254+
::GCToEEInterface::DiagAddNewRegion(generation, rangeStart, rangeEnd, rangeEndReserved);
255+
}
256+
257+
void LogErrorToHost(const char *message)
258+
{
259+
::GCToEEInterface::LogErrorToHost(message);
260+
}
261+
};
262+
}

0 commit comments

Comments
 (0)