Memory watcher for tracking instance lifecycle and allocation 더 자세히 ...
#include <watcher.hpp>
Public 멤버 함수 | |
| life & | operator[] (nidx n) |
| const life & | operator[] (nidx n) const BY_CONST_FUNC(operator[](n)) |
| life & | operator[] (id id) |
| const life & | operator[] (id id) const BY_CONST_FUNC(operator[](id)) |
| life * | get (nidx n) |
| life * | get (id newId) |
| const life * | get (nidx n) const BY_CONST_FUNC(get(n)) const life *get(id new Id) const BY_CONST_FUNC(get(newId)) void *new 1() override |
| Allocates new life object from pre-allocated chunk | |
| nbool | del (void *used, ncnt sz) override |
| Returns life object back to available pool | |
by::chunk(으)로부터 상속된 Public 멤버 함수 | |
| chunk (ncnt blockSz=1, ncnt sz=MIN_SZ) | |
| void * | operator[] (nidx n) |
| const void * | operator[] (nidx n) const BY_CONST_FUNC(operator[](n)) |
| void * | get (nidx n) |
| void * | new1 () override |
| ncnt | len () const override |
| ncnt | size () const override |
| nbool | rel () override |
| nbool | has (const instance &it) const override |
| Checks if this chunk contains the memory allocated for the given instance. | |
by::allocator(으)로부터 상속된 Public 멤버 함수 | |
| allocator (ncnt blksize=1) | |
| ncnt | getBlkSize () const |
by::memoryHaver(으)로부터 상속된 Public 멤버 함수 | |
| nbool | has (const instance *it) const BY_SIDE_FUNC(has) |
| nbool | isFull () const |
| nbool | isCapable () const |
Protected 멤버 함수 | |
| id | _genId (void *pt) const |
| Generates unique id for instance pointer | |
| nidx | _getIdx (void *it) const |
| Calculates index in chunk from pointer address | |
by::chunk(으)로부터 상속된 Protected 멤버 함수 | |
| void * | _get (nidx n) override |
| nuchar * | _getHeap () |
| const nuchar * | _getHeap () const BY_CONST_FUNC(_getHeap()) nbool _resize(ncnt new Sz) |
추가로 상속된 멤버들 | |
by::chunk(으)로부터 상속된 정적 Public 속성 | |
| static constexpr ncnt | MIN_SZ = 20 |
Memory watcher for tracking instance lifecycle and allocation
One pillar of memory management that manages created object lifecycles. Whenever an instance is created, watcher additionally allocates a life object and uses reference counting to determine object destruction timing.
When binder binds an instance, life increments its strong count by 1. When binder calls rel() on instance, decrements count by 1. At 0, deletes from memory. instance uses operator delete() to make instancer execute memory release work.
|
protected |
Generates unique id for instance pointer
|
protected |
Calculates index in chunk from pointer address
|
overridevirtual |
Returns life object back to available pool
by::chunk(으)로부터 재구현되었습니다.
Allocates new life object from pre-allocated chunk