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

Constructor & Destructor Documentation

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

Definition at line 165 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 294 of file Allocator.hpp.

void Allocator::free ( void *  void_address)
inline

Free a previously-allocated chunk.

Definition at line 198 of file Allocator.hpp.

void* Allocator::malloc ( size_t  size)
inline

Allocate size bytes.

Definition at line 209 of file Allocator.hpp.

int64_t Allocator::num_chunks ( ) const
inline

Definition at line 261 of file Allocator.hpp.

int64_t Allocator::total_bytes ( ) const
inline

Definition at line 265 of file Allocator.hpp.

int64_t Allocator::total_bytes_free ( ) const
inline

Definition at line 283 of file Allocator.hpp.

int64_t Allocator::total_bytes_in_use ( ) const
inline

Definition at line 273 of file Allocator.hpp.


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