|
| | DefaultAllocator () |
| | Constructs a DefaultAllocator object with no outstanding allocations.
|
| virtual | ~DefaultAllocator () |
| | Destroys the DefaultAllocator. Outstanding allocations are not freed.
|
| virtual void * | Allocate (size_t size) override |
| | Allocates a block of memory of the given size with the new operator.
|
| virtual void * | AllocateAligned (size_t size, size_t align) override |
| | Allocates a block of memory with the given size and alignment with the new operator.
|
| virtual void | Free (void *buffer) override |
| | Frees memory allocated by Allocate with the delete operator.
|
| virtual void | FreeAligned (void *buffer) override |
| | Frees memory allocated by AllocateAligned with the delete operator.
|
| int | GetNumAllocations () const |
| | Returns the number of outstanding allocations.
|
| virtual | ~Allocator () |
| | Destroys the Allocator.
|
| void | Free (const void *buffer) |
| | Calls the non-const form of Free after casting away the constness of the given pointer.
|
| void | FreeAligned (const void *buffer) |
| | Calls the non-const form of FreeAligned after casting away the constness of the given pointer.
|
| template<typename T> |
| T * | Alloc () |
| | Allocates and returns a pointer to a block of uninitialized memory large enough to accommodate an object of type T.
|
| template<typename T> |
| T * | Alloc (size_t numElements) |
| | Allocates and returns a pointer to a block of uninitialized memory large enough to accommodate an array of objects of type T.
|
| template<typename T> |
| Handle< T > | AllocOwned () |
| | Allocates and returns an owning handle to a block of uninitialized memory large enough to accommodate an object of type T.
|
| template<typename T> |
| Handle< T > | AllocOwned (size_t numElements) |
| | Allocates and returns an owning handle to a block of uninitialized memory large enough to accommodate an array of objects of type T.
|
| template<typename T> |
| T * | AllocAligned (size_t align) |
| | Allocates and returns a pointer to a block of uninitialized aligned memory large enough to accommodate an object of type T.
|
| template<typename T> |
| T * | AllocAligned (size_t numElements, size_t align) |
| | Allocates and returns a pointer to a block of uninitialized aligned memory large enough to accommodate an array of objects of type T.
|
| template<typename T> |
| AlignedHandle< T > | AllocOwnedAligned (size_t align) |
| | Allocates and returns an owning handle to a block of uninitialized aligned memory large enough to accommodate an object of type T.
|
| template<typename T> |
| AlignedHandle< T > | AllocOwnedAligned (size_t numElements, size_t align) |
| | Allocates and returns an owning handle to a block of uninitialized aligned memory large enough to accommodate an array of objects of type T.
|
| template<typename T, typename... Args> |
| T * | AllocObject (Args &&... args) |
| | Allocates, constructs and returns a pointer to an instance of type T.
|
| template<typename T, typename... Args> |
| ObjectHandle< T > | AllocOwnedObject (Args &&... args) |
| | Allocates, constructs and returns an owning handle to an instance of type T.
|
| template<typename T, typename... Args> |
| T * | AllocAlignedObject (size_t align, Args &&... args) |
| | Allocates, constructs and returns a pointer to an aligned instance of type T.
|
| template<typename T, typename... Args> |
| AlignedObjectHandle< T > | AllocOwnedAlignedObject (size_t align, Args &&... args) |
| | Allocates, constructs and returns an owning handle to an aligned instance of type T.
|
A simple implementation of Allocator that allocates and frees memory using the new and delete operators and also tracks the number of outstanding allocations.
Allocation failures are reported by throwing std::bad_alloc.