Sources Pipelines Documentation

Allocators  
All Classes Functions Variables
Public Member Functions | Static Public Member Functions | List of all members
boost::memory::mallocator Class Reference

An allocator backed by malloc and free system calls. More...

#include <mallocator.hpp>

Public Member Functions

memory_block allocate (std::size_t size)
 Allocates a memory_block using malloc. More...
 
void deallocate (memory_block &block)
 Deallocates memory block using free. More...
 
bool owns (memory_block &block)
 Checks if the block has been allocated with this allocator. More...
 

Static Public Member Functions

static mallocatorself_allocate ()
 Allocates an instance of mallocator on the heap. More...
 

Detailed Description

An allocator backed by malloc and free system calls.

Definition at line 14 of file mallocator.hpp.

Member Function Documentation

memory_block boost::memory::mallocator::allocate ( std::size_t  size)
inline

Allocates a memory_block using malloc.

Parameters
size
Returns

Definition at line 27 of file mallocator.ipp.

void boost::memory::mallocator::deallocate ( memory_block block)
inline

Deallocates memory block using free.

Parameters
blockA memory_block to deallocate.

Definition at line 36 of file mallocator.ipp.

bool boost::memory::mallocator::owns ( memory_block block)
inline

Checks if the block has been allocated with this allocator.

Parameters
blockThe block to check.
Returns
true if allocated with this allocator, false otherwise.

Definition at line 42 of file mallocator.ipp.

mallocator * boost::memory::mallocator::self_allocate ( )
inlinestatic

Allocates an instance of mallocator on the heap.

In certain situations it's required to allocate an instance of this allocator on the heap. This method is used to do so.

Returns
A pointer to self allocated instance of mallocator.

Definition at line 16 of file mallocator.ipp.


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