示例#1
0
HRESULT ObjectMemory::InitializeZct()
{
	CRegKey rkDump;
	ZctReserve = ZCTRESERVE;
	ZctMinSize = ZCTINITIALSIZE;
	if (OpenDolphinKey(rkDump, "ObjMem", KEY_READ)==ERROR_SUCCESS)
	{
		DWORD dwValue;
		if (rkDump.QueryDWORDValue("ZMax", dwValue) == ERROR_SUCCESS && dwValue > ZCTMINRESERVE)
			ZctReserve = dwValue;
		if (rkDump.QueryDWORDValue("ZMin", ZctMinSize) == ERROR_SUCCESS && dwValue > ZCTMINSIZE &&
				dwValue < ZctReserve)
			ZctMinSize = dwValue;
	}

	//trace("ZctMinSize = %u, ZctReserve = %u\n", ZctMinSize, ZctReserve);
	m_nZctEntries = 0;
	m_bIsReconcilingZct = false;
	m_pZct = static_cast<OTE**>(::VirtualAlloc(NULL, ZctReserve*sizeof(OTE*), MEM_RESERVE, PAGE_NOACCESS));
	if (!m_pZct)
		return ReportError(IDP_ZCTRESERVEFAIL, ZctReserve, 0);

	m_nZctHighWater = ZctMinSize >> 1;
	GrowZct();

#ifdef _DEBUG
	dwLastReconcileTicks = timeGetTime();
#endif

	return S_OK;
}
示例#2
0
// Static initialization of async call support
void OverlappedCall::Initialize()
{
	HARDASSERT(::GetCurrentThreadId() == Interpreter::MainThreadId());

	CRegKey rkOverlap;
	if (OpenDolphinKey(rkOverlap, L"Overlapped")==ERROR_SUCCESS)
	{
		rkOverlap.QueryDWORDValue(L"TerminateTimeout", s_dwTerminateTimeout);
		s_dwTerminateTimeout = max(s_dwTerminateTimeout, 100);
	}
	else
	{
		s_dwTerminateTimeout = 500;
	}
}