CMemoryPoolPallocManager.h 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2019 Pivotal, Inc.
//
//	@filename:
//		CMemoryPoolPallocManager.h
//
//	@doc:
//		MemoryPoolManager implementation that creates
//		CMemoryPoolPalloc memory pools
//
//---------------------------------------------------------------------------

#ifndef GPDXL_CMemoryPoolPallocManager_H
#define GPDXL_CMemoryPoolPallocManager_H

#include "gpos/base.h"

#include "gpos/memory/CMemoryPoolManager.h"

namespace gpos
{
J
Jesse Zhang 已提交
23 24 25 26 27 28
// memory pool manager that uses GPDB memory contexts
class CMemoryPoolPallocManager : public CMemoryPoolManager
{
private:
	// private no copy ctor
	CMemoryPoolPallocManager(const CMemoryPoolPallocManager &);
29

J
Jesse Zhang 已提交
30 31 32 33
public:
	// ctor
	CMemoryPoolPallocManager(CMemoryPool *internal,
							 EMemoryPoolType memory_pool_type);
34

J
Jesse Zhang 已提交
35 36
	// allocate new memorypool
	virtual CMemoryPool *NewMemoryPool();
37

J
Jesse Zhang 已提交
38 39
	// free allocation
	void DeleteImpl(void *ptr, CMemoryPool::EAllocationType eat);
40

J
Jesse Zhang 已提交
41 42
	// get user requested size of allocation
	ULONG UserSizeOfAlloc(const void *ptr);
43 44


J
Jesse Zhang 已提交
45 46 47
	static GPOS_RESULT Init();
};
}  // namespace gpos
48

J
Jesse Zhang 已提交
49
#endif	// !GPDXL_CMemoryPoolPallocManager_H
50 51

// EOF