Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CMa::FreeStore< Word, Int, Heap > Class Template Reference

#include <free_store.h>

List of all members.

Public Methods

void init ()
void verifyHalt () throw (Error)
Word malloc (Int size)
void free (Int addr) throw (Error)


Detailed Description

template<class Word, class Int, class Heap>
class CMa::FreeStore< Word, Int, Heap >

A parametrized implementation of CMa free store (upper part of heap) manager. Currently just decreases NP on memory requests and does nothing when memory is freed.

Author:
OM
STATUS: NOT TESTED

TODO: Implement garbage collector.


Member Function Documentation

template<class Word, class Int, class Heap>
void CMa::FreeStore< Word, Int, Heap >::free Int    addr throw (Error) [inline]
 

Releases a chunk of memory that was allocated at the given address.

Exceptions:
Error  if the address passed is incorrect
Author:
OM

template<class Word, class Int, class Heap>
void CMa::FreeStore< Word, Int, Heap >::init   [inline]
 

Initializes internal data structures.

Author:
OM

template<class Word, class Int, class Heap>
Word CMa::FreeStore< Word, Int, Heap >::malloc Int    size [inline]
 

Allocates an area of memory consisting of "size" words.

Assumption: size > 0

Returns:
address of newly allocated area or 0, if unsuccessful (because of either NP - size < EP):
Author:
OM/ modified by SL

template<class Word, class Int, class Heap>
void CMa::FreeStore< Word, Int, Heap >::verifyHalt   throw (Error) [inline]
 

Verifies if the free store is in correct state when operation HALT is executed.

Exceptions:
Error  if free store is in incorrect state
Author:
OM


The documentation for this class was generated from the following file:
Generated on Tue Oct 12 03:30:45 1999 by doxygen1.2.18