SilverLining: SilverLining::Allocator Class Reference

SilverLining 2.36

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Static Protected Member Functions
SilverLining::Allocator Class Reference

You may extend the Allocator class to hook your own memory management scheme into SilverLining. More...

`#include <MemAlloc.h>`

Collaboration diagram for SilverLining::Allocator:
[legend]

List of all members.

## Public Member Functions
virtual void *SILVERLINING_API | alloc (size_t bytes)
| Allocate a block of memory; defaults to malloc()
virtual void SILVERLINING_API | dealloc (void *p)
| Free a block of memory; defaults to free()
## Static Public Member Functions
static Allocator *SILVERLINING_API | GetAllocator ()
| Retrieves the static allocator object.
static void SILVERLINING_API | SetAllocator (Allocator *a)
| Sets a new static allocator object.
## Static Protected Member Functions
static Allocator *SILVERLINING_API | GetDefaultAllocator ()
| Retrieves default allocator object.

## Detailed Description

You may extend the Allocator class to hook your own memory management scheme into SilverLining.

Instantiate your own implementation of Allocator, and pass it into Allocator::SetAllocator prior to calling any other SilverLining methods or instantiating any SilverLining objects.

Each object in SilverLining overloads the new and delete operators, and routes memory management through the Allocator as well.

## Member Function Documentation

static void SILVERLINING_API SilverLining::Allocator::SetAllocator | ( | Allocator * | a | ) | `[inline, static]`

Sets a new static allocator object.

If this is not called, the default implementation using malloc and free is used.

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

- /home/fkane/sl/trunk/Public Headers/MemAlloc.h