diff options
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/comutilnative.cpp | 58 | ||||
-rw-r--r-- | src/vm/comutilnative.h | 8 | ||||
-rw-r--r-- | src/vm/ecalllist.h | 6 |
3 files changed, 72 insertions, 0 deletions
diff --git a/src/vm/comutilnative.cpp b/src/vm/comutilnative.cpp index 3ba0acefb9..aa2ed02a40 100644 --- a/src/vm/comutilnative.cpp +++ b/src/vm/comutilnative.cpp @@ -1238,6 +1238,64 @@ FCIMPL0(INT64, GCInterface::GetAllocatedBytesForCurrentThread) } FCIMPLEND +#ifdef FEATURE_BASICFREEZE + +/*===============================RegisterFrozenSegment=============================== +**Action: Registers the frozen segment +**Returns: segment_handle +**Arguments: args-> pointer to section, size of section +**Exceptions: None +==============================================================================*/ +void* QCALLTYPE GCInterface::RegisterFrozenSegment(void* pSection, INT32 sizeSection) +{ + QCALL_CONTRACT; + + void* retVal = nullptr; + + BEGIN_QCALL; + + _ASSERTE(pSection != nullptr); + _ASSERTE(sizeSection > 0); + + GCX_COOP(); + + segment_info seginfo; + seginfo.pvMem = pSection; + seginfo.ibFirstObject = sizeof(ObjHeader); + seginfo.ibAllocated = sizeSection; + seginfo.ibCommit = seginfo.ibAllocated; + seginfo.ibReserved = seginfo.ibAllocated; + + retVal = (void*)GCHeapUtilities::GetGCHeap()->RegisterFrozenSegment(&seginfo); + + END_QCALL; + + return retVal; +} + +/*===============================UnregisterFrozenSegment=============================== +**Action: Unregisters the frozen segment +**Returns: void +**Arguments: args-> segment handle +**Exceptions: None +==============================================================================*/ +void QCALLTYPE GCInterface::UnregisterFrozenSegment(void* segment) +{ + QCALL_CONTRACT; + + BEGIN_QCALL; + + _ASSERTE(segment != nullptr); + + GCX_COOP(); + + GCHeapUtilities::GetGCHeap()->UnregisterFrozenSegment((segment_handle)segment); + + END_QCALL; +} + +#endif // FEATURE_BASICFREEZE + /*==============================SuppressFinalize================================ **Action: Indicate that an object's finalizer should not be run by the system **Arguments: Object of interest diff --git a/src/vm/comutilnative.h b/src/vm/comutilnative.h index e632acfb97..67c111bbb4 100644 --- a/src/vm/comutilnative.h +++ b/src/vm/comutilnative.h @@ -140,6 +140,14 @@ public: static FCDECL0(INT64, GetAllocatedBytesForCurrentThread); +#ifdef FEATURE_BASICFREEZE + static + void* QCALLTYPE RegisterFrozenSegment(void *pSection, INT32 sizeSection); + + static + void QCALLTYPE UnregisterFrozenSegment(void *segmentHandle); +#endif // FEATURE_BASICFREEZE + static int QCALLTYPE StartNoGCRegion(INT64 totalSize, BOOL lohSizeKnown, INT64 lohSize, BOOL disallowFullBlockingGC); diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index 7e1dc6954b..cc07d0e570 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -771,6 +771,12 @@ FCFuncStart(gGCInterfaceFuncs) FCFuncElement("_ReRegisterForFinalize", GCInterface::ReRegisterForFinalize) FCFuncElement("_GetAllocatedBytesForCurrentThread", GCInterface::GetAllocatedBytesForCurrentThread) + +#ifdef FEATURE_BASICFREEZE + QCFuncElement("_RegisterFrozenSegment", GCInterface::RegisterFrozenSegment) + QCFuncElement("_UnregisterFrozenSegment", GCInterface::UnregisterFrozenSegment) +#endif // FEATURE_BASICFREEZE + FCFuncEnd() FCFuncStart(gGCSettingsFuncs) |