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 |
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.
void smol::PageObject::operator delete | ( | void * | obj | ) |
Free the memory of the object again.
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.
size | The size of the memory to allocate. |
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