template<size_t Threshold, Allocator A, Allocator B>
class nda::mem::segregator< Threshold, A, B >
Custom allocator that dispatches memory allocation to one of two allocators based on the size of the memory block to be allocated.
- Note
- Only works if both allocators have the same nda::mem::AddressSpace.
- Template Parameters
-
Definition at line 391 of file allocators.hpp.
|
|
| segregator ()=default |
| | Default constructor.
|
|
| segregator (segregator &&)=default |
| | Default move constructor.
|
|
| segregator (segregator const &)=delete |
| | Deleted copy constructor.
|
| blk_t | allocate (size_t s) noexcept |
| | Allocate memory using the small allocator if the size is less than or equal to the Threshold, otherwise use the big allocator.
|
| blk_t | allocate_zero (size_t s) noexcept |
| | Allocate memory and set the memory to zero using the small allocator if the size is less than or equal to the Threshold, otherwise use the big allocator.
|
| void | deallocate (blk_t b) noexcept |
| | Deallocate memory using the small allocator if the size is less than or equal to the Threshold, otherwise use the big allocator.
|
|
segregator & | operator= (segregator &&)=default |
| | Default move assignment operator.
|
|
segregator & | operator= (segregator const &)=delete |
| | Deleted copy assignment operator.
|
| bool | owns (blk_t b) const noexcept |
| | Check if a given nda::mem::blk_t memory block is owned by the allocator.
|