Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 41 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 74 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 116 of file GlobalAllocator.hpp.

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

delegate free TODO: should free block?

Definition at line 102 of file GlobalAllocator.hpp.

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

delegate malloc

Definition at line 89 of file GlobalAllocator.hpp.

size_t GlobalAllocator::total_bytes ( ) const
inline

Number of bytes available for allocation;.

Definition at line 125 of file GlobalAllocator.hpp.

size_t GlobalAllocator::total_bytes_in_use ( ) const
inline

Number of bytes allocated.

Definition at line 127 of file GlobalAllocator.hpp.


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