smol::PageObject Class Reference

Inheritance diagram for smol::PageObject:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 PageObject (void) throw (std::bad_alloc)
void * operator new (size_t size) throw (std::bad_alloc)
void operator delete (void *obj)

Protected Attributes

size_t po_size
uint32_t po_magic


Detailed Description

Instances of this class are always alloc at the beginning of a page and are guarantied to own all pages that are touched by the object.

Constructor & Destructor Documentation

smol::PageObject::PageObject ( void   )  throw (std::bad_alloc)

Constructor. If there is no constructor defined the compiler will clear the memory of the object. This constructor also check about the po_magic value to see of the object has been dynamically or statically allocated.


Member Function Documentation

void smol::PageObject::operator delete ( void *  obj  ) 

Free the memory of the object again.

Parameters:
obj Pointer to the memory to free.

void* smol::PageObject::operator new ( size_t  size  )  throw (std::bad_alloc)

This operator take care that the object always is located in a buffer that is page aligned and that all pages that are touched by the object are exclusively reserved for this object.

Parameters:
size The size of the memory to allocate.
Returns:
Pointer to the allocated memory.


Member Data Documentation

uint32_t smol::PageObject::po_magic [protected]

The po_magic value is used to detect if an object is statically or dyanamically created. The correct value only set in the new operator.

size_t smol::PageObject::po_size [protected]

Contains the size of the memory that is associated with this object in bytes. (Always multiple of PAGESIZE). This value is set by the allocator function and NOT by the constructor


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

Generated on Sat Aug 1 18:44:15 2009 for SMOL by  doxygen 1.5.8