Class SizeClassAllocator
Defined in File SizeClassAllocator.h
Nested Relationships
Nested Types
Class Documentation
-
class SizeClassAllocator
an allocator of small blocks by size classes, for one thread
Public Functions
-
SizeClassAllocator(void) = default
-
SizeClassAllocator(const SizeClassAllocator&) = delete
-
SizeClassAllocator &operator=(const SizeClassAllocator&) = delete
-
SizeClassAllocator(SizeClassAllocator &&other) noexcept
the pages of other, which is left empty
-
SizeClassAllocator &operator=(SizeClassAllocator &&other) noexcept
-
inline ~SizeClassAllocator()
frees the pages
-
void *allocate(std::size_t n)
a block of n bytes at least, aligned to 16 bytes (to the power of 2 that divides its class, 8 for the class of 8 bytes)
- Pre:
n >= 1
-
void deallocate(void *p, std::size_t n) noexcept
gives back the block p of a request of n bytes
- Pre:
p was given by allocate( n ) of this allocator
-
inline std::size_t bytes(void) const
the memory of the pages, in bytes
-
void release(void) noexcept
frees all the pages; the blocks given are no longer valid
-
SizeClassAllocator(void) = default