|
|
|
|
|
|
Modules Namespace List Class Hierarchy Alphabetical List Compound List Namespace Members Compound Members Related Pages
acdk::lang::sys::PagedAllocator Class Reference#include <PagedAllocator.h>
Inheritance diagram for acdk::lang::sys::PagedAllocator:
List of all members.
|
Public Member Functions |
| PagedAllocator (int size, int bufferedPages=100) |
virtual | ~PagedAllocator () |
virtual void * | allocate (size_t size, AllocatedType at=RawMem) |
| Allocates Memory.
|
virtual void | deallocate (void *ptr, AllocatedType at=RawMem) |
| Frees Memory.
|
virtual void * | raw_allocate (size_t size, AllocatedType type) |
virtual void | raw_deallocate (size_t size, void *ptr, AllocatedType type) |
virtual void | listObjects (::acdk::lang::ref::NotifyObjectEventListener *listener, int flags) |
PagedAllocatorPage * | _allocatePage (int size=0) |
void | _deallocatePage (PagedAllocatorPage *page) |
void * | allocate (int size, short type) |
void | dumpStatistics (bool withDetails=false, int memberlevel=0, bool onlyumarked=false) |
| dump statistics of Alloctor on cout
- withDetails dumps with details on heap memory objects
- memberlevel if memory object is Object, dump information about member recursivly * memberlevel
|
int | getElementCount (AllocatedType type) const |
| count of elements in the pages
|
int | getAllocatedCount (AllocatedType type) const |
| return number of bytes allocated by given type
|
bool | doGc (bool threadStorage=true, bool force=false) |
| try to free memory.
|
Protected Member Functions |
void * | _allocate (int size, short type) |
void * | _allocateObject (int size) |
void | _deallocateObject (void *ptr) |
PagedAllocatorPage * | _allocatePage2 (int size) |
void | _deallocatePage2 (PagedAllocatorPage *page) |
Protected Attributes |
int | _standardPageSize |
PagedAllocatorPage * | _first |
PagedAllocatorPage * | _last |
int | _reservedPages |
core_vector< PagedAllocatorPage * > | _bufferedPages |
int | _maxBufferedPages |
PagedHeap * | _heap |
| if _heap != 0, Allocator should inform on changes (destroyObject)
|
Friends |
class | PagedHeap |
class | PagedAllocatorObjectsIterator |
Constructor & Destructor Documentation
acdk::lang::sys::PagedAllocator::PagedAllocator |
( |
int |
size, |
|
|
int |
bufferedPages = 100 |
|
) |
|
|
virtual acdk::lang::sys::PagedAllocator::~PagedAllocator |
( |
|
) |
[virtual] |
|
Member Function Documentation
void* acdk::lang::sys::PagedAllocator::_allocate |
( |
int |
size, |
|
|
short |
type |
|
) |
[protected] |
|
void* acdk::lang::sys::PagedAllocator::_allocateObject |
( |
int |
size |
) |
[protected] |
|
PagedAllocatorPage* acdk::lang::sys::PagedAllocator::_allocatePage2 |
( |
int |
size |
) |
[protected] |
|
void acdk::lang::sys::PagedAllocator::_deallocateObject |
( |
void * |
ptr |
) |
[protected] |
|
void acdk::lang::sys::PagedAllocator::_deallocatePage2 |
( |
PagedAllocatorPage * |
page |
) |
[protected] |
|
void* acdk::lang::sys::PagedAllocator::allocate |
( |
int |
size, |
|
|
short |
type |
|
) |
|
|
virtual void* acdk::lang::sys::PagedAllocator::allocate |
( |
size_t |
size, |
|
|
AllocatedType |
at = RawMem |
|
) |
[virtual] |
|
virtual void acdk::lang::sys::PagedAllocator::deallocate |
( |
void * |
ptr, |
|
|
AllocatedType |
at = RawMem |
|
) |
[virtual] |
|
bool acdk::lang::sys::PagedAllocator::doGc |
( |
bool |
threadStorage = true, |
|
|
bool |
force = false |
|
) |
[virtual] |
|
|
try to free memory.
- Returns:
- true if any memory was freed
- Parameters:
-
force | if true free also internal cached elements for PageAllocator if not true always return false |
Reimplemented from acdk::lang::sys::AbstractAllocator. |
void acdk::lang::sys::PagedAllocator::dumpStatistics |
( |
bool |
withDetails = false, |
|
|
int |
memberlevel = 0, |
|
|
bool |
onlyumarked = false |
|
) |
|
|
|
dump statistics of Alloctor on cout
- withDetails dumps with details on heap memory objects
- memberlevel if memory object is Object, dump information about member recursivly * memberlevel
|
int acdk::lang::sys::PagedAllocator::getAllocatedCount |
( |
AllocatedType |
type |
) |
const |
|
|
return number of bytes allocated by given type
|
int acdk::lang::sys::PagedAllocator::getElementCount |
( |
AllocatedType |
type |
) |
const |
|
|
count of elements in the pages
|
virtual void* acdk::lang::sys::PagedAllocator::raw_allocate |
( |
size_t |
size, |
|
|
AllocatedType |
type |
|
) |
[virtual] |
|
virtual void acdk::lang::sys::PagedAllocator::raw_deallocate |
( |
size_t |
size, |
|
|
void * |
ptr, |
|
|
AllocatedType |
type |
|
) |
[virtual] |
|
Friends And Related Function Documentation
friend class PagedAllocatorObjectsIterator [friend]
|
|
Member Data Documentation
|
if _heap != 0, Allocator should inform on changes (destroyObject)
|
|
|