greenplumn CMemoryPoolPallocManager 源码

  • 2022-08-18
  • 浏览 (468)

greenplumn CMemoryPoolPallocManager 代码

文件路径:/src/backend/gpopt/utils/CMemoryPoolPallocManager.cpp

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2019 VMware, Inc. or its affiliates.
//
//	@filename:
//		CMemoryPoolPallocManager.cpp
//
//	@doc:
//		MemoryPoolManager implementation that creates
//		CMemoryPoolPalloc memory pools
//
//---------------------------------------------------------------------------

extern "C" {
#include "postgres.h"

#include "utils/memutils.h"
}

#include "gpopt/utils/CMemoryPoolPalloc.h"
#include "gpopt/utils/CMemoryPoolPallocManager.h"

using namespace gpos;

// ctor
CMemoryPoolPallocManager::CMemoryPoolPallocManager(CMemoryPool *internal,
												   EMemoryPoolType)
	: CMemoryPoolManager(internal, EMemoryPoolExternal)
{
}

// create new memory pool
CMemoryPool *
CMemoryPoolPallocManager::NewMemoryPool()
{
	return GPOS_NEW(GetInternalMemoryPool()) CMemoryPoolPalloc();
}

void
CMemoryPoolPallocManager::DeleteImpl(void *ptr,
									 CMemoryPool::EAllocationType eat)
{
	CMemoryPoolPalloc::DeleteImpl(ptr, eat);
}

// get user requested size of allocation
ULONG
CMemoryPoolPallocManager::UserSizeOfAlloc(const void *ptr)
{
	return CMemoryPoolPalloc::UserSizeOfAlloc(ptr);
}

GPOS_RESULT
CMemoryPoolPallocManager::Init()
{
	return CMemoryPoolManager::SetupGlobalMemoryPoolManager<
		CMemoryPoolPallocManager, CMemoryPoolPalloc>();
}

// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CConstExprEvaluatorProxy 源码

greenplumn CMemoryPoolPalloc 源码

greenplumn COptTasks 源码

greenplumn RelationWrapper 源码

greenplumn funcs 源码

0  赞