|
rippled
|
#include <SlabAllocator.h>

Classes | |
| struct | SlabBlock |
| A block of memory that is owned by a slab allocator. More... | |
Public Member Functions | |
| constexpr | SlabAllocator (std::size_t extra, std::size_t alloc=0, std::size_t align=0) |
| Constructs a slab allocator able to allocate objects of a fixed size. | |
| SlabAllocator (SlabAllocator const &other)=delete | |
| SlabAllocator & | operator= (SlabAllocator const &other)=delete |
| SlabAllocator (SlabAllocator &&other)=delete | |
| SlabAllocator & | operator= (SlabAllocator &&other)=delete |
| ~SlabAllocator () | |
| constexpr std::size_t | size () const noexcept |
| Returns the size of the memory block this allocator returns. | |
| std::uint8_t * | allocate () noexcept |
| Returns a suitably aligned pointer, if one is available. | |
| bool | deallocate (std::uint8_t *ptr) noexcept |
| Returns the memory block to the allocator. | |
Private Attributes | |
| std::atomic< SlabBlock * > | slabs_ = nullptr |
| std::size_t const | itemAlignment_ |
| std::size_t const | itemSize_ |
| std::size_t const | slabSize_ |
Definition at line 45 of file SlabAllocator.h.
|
explicitconstexpr |
Constructs a slab allocator able to allocate objects of a fixed size.
| count | the number of items the slab allocator can allocate; note that a count of 0 is valid and means that the allocator is, effectively, disabled. This can be very useful in some contexts (e.g. when mimimal memory usage is needed) and allows for graceful failure. |
Definition at line 182 of file SlabAllocator.h.
|
delete |
|
delete |
| ripple::SlabAllocator< Type >::~SlabAllocator | ( | ) |
Definition at line 204 of file SlabAllocator.h.
|
delete |
|
delete |
|
constexprnoexcept |
Returns the size of the memory block this allocator returns.
Definition at line 213 of file SlabAllocator.h.
|
noexcept |
Returns a suitably aligned pointer, if one is available.
Definition at line 224 of file SlabAllocator.h.
|
noexcept |
Returns the memory block to the allocator.
| ptr | A pointer to a memory block. |
| size | If non-zero, a hint as to the size of the block. |
Definition at line 301 of file SlabAllocator.h.
|
private |
Definition at line 161 of file SlabAllocator.h.
|
private |
Definition at line 164 of file SlabAllocator.h.
|
private |
Definition at line 168 of file SlabAllocator.h.
|
private |
Definition at line 171 of file SlabAllocator.h.