diff options
author | Mukul Sabharwal <muks@microsoft.com> | 2019-02-22 15:56:28 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2019-02-22 15:56:28 -0800 |
commit | 4932d0f6fa87b9a6e3293aacd35cecedde44d87a (patch) | |
tree | 0330e86de295b7d14c8db32478a8aff76147e685 /src/vm/comutilnative.cpp | |
parent | 6a392d9084a1afe8b9861138e5d0e5b688deca44 (diff) | |
download | coreclr-4932d0f6fa87b9a6e3293aacd35cecedde44d87a.tar.gz coreclr-4932d0f6fa87b9a6e3293aacd35cecedde44d87a.tar.bz2 coreclr-4932d0f6fa87b9a6e3293aacd35cecedde44d87a.zip |
Enable FEATURE_BASICFREEZE (#22776)
Diffstat (limited to 'src/vm/comutilnative.cpp')
-rw-r--r-- | src/vm/comutilnative.cpp | 58 |
1 files changed, 58 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 |