本文整理汇总了C++中CAutoMemoryPool::PmpDetach方法的典型用法代码示例。如果您正苦于以下问题:C++ CAutoMemoryPool::PmpDetach方法的具体用法?C++ CAutoMemoryPool::PmpDetach怎么用?C++ CAutoMemoryPool::PmpDetach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAutoMemoryPool
的用法示例。
在下文中一共展示了CAutoMemoryPool::PmpDetach方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 *pmp = amp.Pmp();
CTestUtils::InitProviderFile(pmp);
// detach safety
(void) amp.PmpDetach();
}
#ifdef GPOS_DEBUG
// reset xforms factory to exercise xforms ctors and dtors
CXformFactory::Pxff()->Shutdown();
GPOS_RESULT eres = CXformFactory::EresInit();
GPOS_ASSERT(GPOS_OK == eres);
#endif // GPOS_DEBUG
}
示例2: gpopt_init
//---------------------------------------------------------------------------
// @function:
// gpopt_init
//
// @doc:
// Initialize gpopt library. To enable memory allocations
// via a custom allocator, pass in non-NULL fnAlloc/fnFree
// allocation/deallocation functions. If either of the parameters
// are NULL, gpopt with be initialized with the default allocator.
//
//---------------------------------------------------------------------------
void gpopt_init()
{
{
CAutoMemoryPool amp;
pmp = amp.Pmp();
// add standard exception messages
(void) gpopt::EresExceptionInit(pmp);
// detach safety
(void) amp.PmpDetach();
}
if (GPOS_OK != gpopt::CXformFactory::EresInit())
{
return;
}
}
示例3:
//---------------------------------------------------------------------------
// @function:
// CColumnFactory::CColumnFactory
//
// @doc:
// ctor
//
//---------------------------------------------------------------------------
CColumnFactory::CColumnFactory()
:
m_pmp(NULL),
m_phmcrcrs(NULL)
{
CAutoMemoryPool amp;
m_pmp = amp.Pmp();
// initialize hash table
m_sht.Init
(
m_pmp,
GPOPT_COLFACTORY_HT_BUCKETS,
GPOS_OFFSET(CColRef, m_link),
GPOS_OFFSET(CColRef, m_ulId),
&(CColRef::m_ulInvalid),
CColRef::UlHash,
CColRef::FEqual
);
// now it's safe to detach the auto pool
(void) amp.PmpDetach();
}