![]() |
Castor3D 0.17.0
Multiplatform 3D engine
|
Buddy allocator implementation. More...
#include <BuddyAllocator.hpp>


Public Member Functions | |
| BuddyAllocatorT (uint32_t numLevels, uint32_t minBlockSize) | |
| Constructor. | |
| size_t | getAvailable () const noexcept |
| bool | hasAvailable (size_t size) const |
| PointerType | allocate (size_t size) |
| Allocates memory. | |
| void | deallocate (PointerType pointer) |
| Deallocates memory. | |
| size_t | getTotalSize () const |
| The pool total size. | |
| size_t | getAlignSize () const |
Buddy allocator implementation.
| castor::BuddyAllocatorT< Traits >::BuddyAllocatorT | ( | uint32_t | numLevels, |
| uint32_t | minBlockSize ) |
Constructor.
| [in] | numLevels | The allocator maximum tree size. |
| [in] | minBlockSize | The minimum size for a block. |
| PointerType castor::BuddyAllocatorT< Traits >::allocate | ( | size_t | size | ) |
Allocates memory.
| [in] | size | The requested memory size. |
| void castor::BuddyAllocatorT< Traits >::deallocate | ( | PointerType | pointer | ) |
Deallocates memory.
| [in] | pointer | The memory chunk. |
|
inline |
|
noexcept |
| size_t castor::BuddyAllocatorT< Traits >::getTotalSize | ( | ) | const |
The pool total size.
| bool castor::BuddyAllocatorT< Traits >::hasAvailable | ( | size_t | size | ) | const |
| [in] | size | The requested memory size. |
true if there is enough remaining memory for given size.