Windows2003-3790/windows/advcore/duser/engine/base/tempheap.inl
2020-09-30 16:53:55 +02:00

69 lines
1.7 KiB
C++

/***************************************************************************\
*
* File: TempHelp.inl
*
* History:
* 3/30/2000: JStall: Created
*
* Copyright (C) 2000 by Microsoft Corporation. All rights reserved.
*
\***************************************************************************/
#if !defined(BASE__TempHeap_inl__INCLUDED)
#define BASE__TempHeap_inl__INCLUDED
#pragma once
/***************************************************************************\
*****************************************************************************
*
* class TempHeap
*
*****************************************************************************
\***************************************************************************/
//------------------------------------------------------------------------------
inline
TempHeap::~TempHeap()
{
Destroy();
}
//------------------------------------------------------------------------------
inline void
TempHeap::Destroy()
{
FreeAll(TRUE /* Complete */);
}
//------------------------------------------------------------------------------
inline BOOL
TempHeap::IsCompletelyFree() const
{
return (m_ppageCur == NULL) && (m_ppageLarge == NULL);
}
//------------------------------------------------------------------------------
inline void
TempHeap::Lock()
{
m_cLocks++;
}
//------------------------------------------------------------------------------
inline void
TempHeap::Unlock()
{
AssertMsg(m_cLocks > 0, "Must have an outstanding lock");
if (--m_cLocks == 0) {
FreeAll(FALSE);
}
}
#endif // BASE__TempHeap_inl__INCLUDED