Allocator.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/base/memory/Allocator.hpp"

AllocatorPoolInfo

Pool Information for Pool Allocators.

namespace oatpp { namespace base { namespace memory { 
  class AllocatorPoolInfo {}
}}}

Fields

Type Name Summary
const char* const poolName Memory pool name.
const v_int32 poolChunkSize Memory pool chunk size. For more about chunk size see oatpp::base::memory::MemoryPool::MemoryPool().

Methods

Return Type Name Summary
[none] AllocatorPoolInfo Constructor.

AllocatorPoolInfo::poolName

Memory pool name.

const char* const poolName

AllocatorPoolInfo::poolChunkSize

Memory pool chunk size. For more about chunk size see oatpp::base::memory::MemoryPool::MemoryPool().

const v_int32 poolChunkSize

AllocatorPoolInfo::AllocatorPoolInfo

Constructor.

AllocatorPoolInfo(const char* pPoolName, v_int32 pPoolChunkSize)

PoolSharedObjectAllocator

Allocator to allocate shared object on oatpp::base::memory::MemoryPool Used to allocate shared_ptr control block and an object in the same memory entry of the pool.

  • @tparam T - type of the object to allocate.

namespace oatpp { namespace base { namespace memory { 
  template<class T>
  class PoolSharedObjectAllocator {}
}}}

ThreadLocalPoolSharedObjectAllocator

Same as PoolSharedObjectAllocator but uses thread_local oatpp::base::memory::MemoryPool.
If built with OATPP_COMPAT_BUILD_NO_THREAD_LOCAL flag - same as PoolSharedObjectAllocator.

  • @tparam T - type of the object to allocate.

namespace oatpp { namespace base { namespace memory { 
  template<class T>
  class ThreadLocalPoolSharedObjectAllocator {}
}}}

AllocationExtras

Extra information for, and about allocation. Used for variable-size objects allocations. (ex.: for strings).

namespace oatpp { namespace base { namespace memory { 
  class AllocationExtras {}
}}}

SharedObjectAllocator

Allocator for shared objects. Used to allocate object and shared_ptr's control block in the same memory entry.

  • @tparam T - type of the object to allocate.

namespace oatpp { namespace base { namespace memory { 
  template<class T>
  class SharedObjectAllocator {}
}}}

CustomPoolSharedObjectAllocator

Allocator for shared objects. Allocates objects on the pool provided.

  • @tparam T - type of object to allocate.
  • @tparam P - type of memory pool to allocate object on.

namespace oatpp { namespace base { namespace memory { 
  template<class T, class P>
  class CustomPoolSharedObjectAllocator {}
}}}