Allocator Builder
Policy Based C++ Template Allocator Library
 All Classes Functions Variables Enumerations Enumerator Groups Pages
alb::v_100::mallocator Class Reference

#include <mallocator.hpp>

Public Member Functions

block allocate (size_t n) noexcept
 
bool reallocate (block &b, size_t n) noexcept
 
void deallocate (block &b) noexcept
 

Static Public Attributes

static constexpr bool supports_truncated_deallocation = false
 
static constexpr unsigned alignment = 4
 

Detailed Description

This class implements a facade against the system ::malloc()

Definition at line 22 of file mallocator.hpp.

Member Function Documentation

block alb::v_100::mallocator::allocate ( size_t  n)
inlinenoexcept

Allocates the specified number of bytes. If the system cannot allocate the specified amount of memory then a null Block is returned.

Parameters
nThe number of bytes.
Returns
Block with memory information

Definition at line 34 of file mallocator.hpp.

void alb::v_100::mallocator::deallocate ( block b)
inlinenoexcept

Frees the given block and resets it.

Parameters
bBlock to be freed.

Definition at line 73 of file mallocator.hpp.

bool alb::v_100::mallocator::reallocate ( block b,
size_t  n 
)
inlinenoexcept

Reallocate the specified block to the specified size.

Parameters
bThe block to be reallocated
nThe new size
Returns
True, if the operation was successful.

Definition at line 55 of file mallocator.hpp.


The documentation for this class was generated from the following file: