Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
GlobalAllocator Class Reference

Global memory allocator. More...

#include <GlobalAllocator.hpp>

Public Member Functions

 GlobalAllocator (GlobalAddress< void > base, size_t size)
 Construct global allocator. More...
 
std::ostream & dump (std::ostream &o) const
 human-readable allocator state (not to be called directly—called by 'operator<<' overload) More...
 
size_t total_bytes () const
 Number of bytes available for allocation;. More...
 
size_t total_bytes_in_use () const
 Number of bytes allocated. More...
 

Static Public Member Functions

static GlobalAddress< void > remote_malloc (size_t size_bytes)
 delegate malloc More...
 
static void remote_free (GlobalAddress< void > address)
 delegate free TODO: should free block? More...
 

Detailed Description

Global memory allocator.

Definition at line 52 of file GlobalAllocator.hpp.

Constructor & Destructor Documentation

GlobalAllocator::GlobalAllocator ( GlobalAddress< void >  base,
size_t  size 
)
inline

Construct global allocator.

Allocates no storage, just controls ownership of memory region.

Parameters
basebase address of region to allocate from
sizenumber of bytes available for allocation

Definition at line 85 of file GlobalAllocator.hpp.

Member Function Documentation

std::ostream& GlobalAllocator::dump ( std::ostream &  o) const
inline

human-readable allocator state (not to be called directly—called by 'operator<<' overload)

Definition at line 127 of file GlobalAllocator.hpp.

static void GlobalAllocator::remote_free ( GlobalAddress< void >  address)
inlinestatic

delegate free TODO: should free block?

Definition at line 113 of file GlobalAllocator.hpp.

static GlobalAddress< void > GlobalAllocator::remote_malloc ( size_t  size_bytes)
inlinestatic

delegate malloc

Definition at line 100 of file GlobalAllocator.hpp.

size_t GlobalAllocator::total_bytes ( ) const
inline

Number of bytes available for allocation;.

Definition at line 136 of file GlobalAllocator.hpp.

size_t GlobalAllocator::total_bytes_in_use ( ) const
inline

Number of bytes allocated.

Definition at line 138 of file GlobalAllocator.hpp.


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