libtgd 5.0
A library that makes working with multidimensional arrays in C++ easy
TGD::Allocator Class Reference

The default allocator based on new[] and delete[]. More...

#include <alloc.hpp>

Inherited by TGD::MmapAllocator.

Public Member Functions

 Allocator ()
 Constructor.
 
virtual ~Allocator ()
 Destructor.
 
virtual unsigned char * allocate (std::size_t n) const
 Allocates n bytes via new[].
 
virtual std::function< void(unsigned char *p)> getDeallocator (std::size_t) const
 Returns a function that deallocates memory via delete[].
 
virtual bool clearsMemory () const
 Returns whether this allocator clears allocated memory.
 

Detailed Description

The default allocator based on new[] and delete[].

Constructor & Destructor Documentation

◆ Allocator()

TGD::Allocator::Allocator ( )
inline

Constructor.

◆ ~Allocator()

virtual TGD::Allocator::~Allocator ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ allocate()

virtual unsigned char * TGD::Allocator::allocate ( std::size_t n) const
inlinevirtual

Allocates n bytes via new[].

Reimplemented in TGD::MmapAllocator.

◆ clearsMemory()

virtual bool TGD::Allocator::clearsMemory ( ) const
inlinevirtual

Returns whether this allocator clears allocated memory.

Reimplemented in TGD::MmapAllocator.

◆ getDeallocator()

virtual std::function< void(unsigned char *p)> TGD::Allocator::getDeallocator ( std::size_t ) const
inlinevirtual

Returns a function that deallocates memory via delete[].

Reimplemented in TGD::MmapAllocator.


The documentation for this class was generated from the following file: