CS::Memory::CustomAllocated Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

CS::Memory::CustomAllocated Class Reference

Class that overrides operator new/operator delete/etc. More...

`#include <csutil/customallocated.h>`

Inheritance diagram for CS::Memory::CustomAllocated:

List of all members.

## Detailed Description

Class that overrides operator new/operator delete/etc.

with implementations using cs_malloc()/cs_free().

Remarks:
  To outfit a class that also derives from another class with custom allocation don't use multiple inheritance, use CustomAllocatedDerived<> instead.

The reason is that the CustomAllocated instance contained in the derived class may take up some memory (in order to have a distinct address in memory), memory which is otherwise unused and wasted. CustomAllocatedDerived<> works around that as it is a base class and can thus be empty; derivation is supported through templating. (For details see http://www.cantrip.org/emptyopt.html .)

Definition at line 46 of file customallocated.h.

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

- csutil/customallocated.h