Base class for return-by-pointer memory management. More...
#include <retain.h>

Public Types | |
| enum | pooltype { onstack } |
Public Member Functions | |
| retainable (void) | |
| virtual | ~retainable (void) |
| void * | operator new (size_t sz) |
| void | operator delete (void *v) |
| void * | operator new (size_t sz, pooltype r) |
| void | operator delete (void *v, pooltype r) |
Protected Member Functions | |
| void | retainvalue (retainable *r) |
| void | destroyvalue (retainable *r) |
| virtual void | init (bool first=true) |
Base class for return-by-pointer memory management.
Uses a custom allocator if the memory::retainable::onstack argument is given to new, in which case the memory will not be allocated through normal malloc(). Instead, a block is taken out of the preallocated memory pool.
| void memory::retainable::retainvalue | ( | retainable * | r | ) | [protected] |
Call this from any operator= or copy constructor methods.
References memory::pool::free(), and memory::pool::getsize().
Referenced by currency::currency(), and statstring::statstring().

1.6.1