SmallObject Class Reference
[PEARL.base]

Provides a base class for small objects using a custom memory management. More...

#include <SmallObject.h>

Inheritance diagram for SmallObject:

Event_rep

List of all members.

Public Member Functions

Constructors & destructor
virtual ~SmallObject ()

Static Public Member Functions

Memory allocation operators
static void * operator new (std::size_t objectSize) throw (std::bad_alloc)
static void operator delete (void *deadObject, std::size_t objectSize)


Detailed Description

Each dynamically allocated memory block usually requires some extra memory for bookkeeping purposes. However, this can be quite space inefficient if a large number of small objects is allocated, as the per-object overhead is significant.

The SmallObject class serves as a base class that can be used for these kind of small objects, providing a customized memory management that allocates memory in larger chunks rather than for each object individually. This specialized memory management is restricted to objects of not more than 64 bytes, however, if objects grow larger (e.g., objects of a derived class) the default memory allocation routines are used transparently.


SCALASCA    Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre