internal static extern unsafe void RhDisableConservativeReportingRegion(ConservativelyReportedRegionDesc* regionDesc);
public static unsafe void RhDisableConservativeReportingRegion(ConservativelyReportedRegionDesc* regionDesc) { regionDesc->_magic = default(UIntPtr); }
internal static extern unsafe void RhInitializeConservativeReportingRegion(ConservativelyReportedRegionDesc* regionDesc, void* bufferBegin, int cbBuffer);
public static unsafe void RhInitializeConservativeReportingRegion(ConservativelyReportedRegionDesc* regionDesc, void* bufferBegin, int cbBuffer) { Debug.Assert((((int)bufferBegin) & (sizeof(IntPtr) - 1)) == 0, "Buffer not IntPtr aligned"); Debug.Assert((cbBuffer & (sizeof(IntPtr) - 1)) == 0, "Size of buffer not IntPtr aligned"); UIntPtr regionPointerLow = (UIntPtr)bufferBegin; UIntPtr regionPointerHigh = (UIntPtr)(((byte*)bufferBegin) + cbBuffer); // Setup pointers to start and end of region regionDesc->_regionPointerLow = regionPointerLow; regionDesc->_regionPointerHigh = regionPointerHigh; // Activate the region for processing #if BIT64 ulong hash = ConservativelyReportedRegionDesc.MagicNumber64; hash = ((hash << 13) ^ hash) ^ (ulong)regionPointerLow; hash = ((hash << 13) ^ hash) ^ (ulong)regionPointerHigh; regionDesc->_hash = new UIntPtr(hash); regionDesc->_magic = new UIntPtr(ConservativelyReportedRegionDesc.MagicNumber64); #else uint hash = ConservativelyReportedRegionDesc.MagicNumber32; hash = ((hash << 13) ^ hash) ^ (uint)regionPointerLow; hash = ((hash << 13) ^ hash) ^ (uint)regionPointerHigh; regionDesc->_hash = new UIntPtr(hash); regionDesc->_magic = new UIntPtr(ConservativelyReportedRegionDesc.MagicNumber32); #endif }