Grappa  r3821, hash 22cd626d567a91ead5b23302066d1e9469f45c66
Allocator Class Reference

Generic buddy allocator. More...

#include <Allocator.hpp>

Classes

class  Exception
 

Public Member Functions

 Allocator (void *base, int64_t size)
 
void free (void *void_address)
 Free a previously-allocated chunk. More...
 
void * malloc (size_t size)
 Allocate size bytes. More...
 
int64_t num_chunks () const
 
int64_t total_bytes () const
 
int64_t total_bytes_in_use () const
 
int64_t total_bytes_free () const
 
std::ostream & dump (std::ostream &o=std::cout) const
 output human-readable state More...
 

Detailed Description

Generic buddy allocator.

Used by GlobalAllocator to implement global heap.

Definition at line 98 of file Allocator.hpp.

Constructor & Destructor Documentation

Allocator::Allocator ( void *  base,
int64_t  size 
)
inline

Definition at line 176 of file Allocator.hpp.

Member Function Documentation

std::ostream& Allocator::dump ( std::ostream &  o = std::cout) const
inline

output human-readable state

Definition at line 305 of file Allocator.hpp.

void Allocator::free ( void *  void_address)
inline

Free a previously-allocated chunk.

Definition at line 209 of file Allocator.hpp.

void* Allocator::malloc ( size_t  size)
inline

Allocate size bytes.

Definition at line 220 of file Allocator.hpp.

int64_t Allocator::num_chunks ( ) const
inline

Definition at line 272 of file Allocator.hpp.

int64_t Allocator::total_bytes ( ) const
inline

Definition at line 276 of file Allocator.hpp.

int64_t Allocator::total_bytes_free ( ) const
inline

Definition at line 294 of file Allocator.hpp.

int64_t Allocator::total_bytes_in_use ( ) const
inline

Definition at line 284 of file Allocator.hpp.


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