本文整理汇总了C++中CAutoMemoryPool::Detach方法的典型用法代码示例。如果您正苦于以下问题:C++ CAutoMemoryPool::Detach方法的具体用法?C++ CAutoMemoryPool::Detach怎么用?C++ CAutoMemoryPool::Detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAutoMemoryPool
的用法示例。
在下文中一共展示了CAutoMemoryPool::Detach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConfigureTests
//---------------------------------------------------------------------------
// @function:
// ConfigureTests
//
// @doc:
// Configurations needed before running unittests
//
//---------------------------------------------------------------------------
void ConfigureTests()
{
// initialize DXL support
InitDXL();
CMDCache::Init();
// load metadata objects into provider file
{
CAutoMemoryPool amp;
IMemoryPool *mp = amp.Pmp();
CTestUtils::InitProviderFile(mp);
// detach safety
(void) amp.Detach();
}
#ifdef GPOS_DEBUG
// reset xforms factory to exercise xforms ctors and dtors
CXformFactory::Pxff()->Shutdown();
GPOS_RESULT eres = CXformFactory::Init();
GPOS_ASSERT(GPOS_OK == eres);
#endif // GPOS_DEBUG
}
示例2:
//---------------------------------------------------------------------------
// @function:
// CColumnFactory::CColumnFactory
//
// @doc:
// ctor
//
//---------------------------------------------------------------------------
CColumnFactory::CColumnFactory()
:
m_mp(NULL),
m_phmcrcrs(NULL)
{
CAutoMemoryPool amp;
m_mp = amp.Pmp();
// initialize hash table
m_sht.Init
(
m_mp,
GPOPT_COLFACTORY_HT_BUCKETS,
GPOS_OFFSET(CColRef, m_link),
GPOS_OFFSET(CColRef, m_id),
&(CColRef::m_ulInvalid),
CColRef::HashValue,
CColRef::Equals
);
// now it's safe to detach the auto pool
(void) amp.Detach();
}