로딩중...
검색중...
일치하는것 없음
by::watcher 클래스 참조

Memory watcher for tracking instance lifecycle and allocation 더 자세히 ...

#include <watcher.hpp>

by::watcher에 대한 상속 다이어그램 :
by::chunk by::allocator by::memoryHaver

Public 멤버 함수

lifeoperator[] (nidx n)
 
const lifeoperator[] (nidx n) const BY_CONST_FUNC(operator[](n))
 
lifeoperator[] (id id)
 
const lifeoperator[] (id id) const BY_CONST_FUNC(operator[](id))
 
lifeget (nidx n)
 
lifeget (id newId)
 
const lifeget (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.

Reference counting

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.

멤버 함수 문서화

◆ _genId()

id by::watcher::_genId ( void * pt) const
protected

Generates unique id for instance pointer

반환값
Generated id combining pointer address information
주의
Used internally to create ids for newly allocated instances

◆ _getIdx()

nidx by::watcher::_getIdx ( void * it) const
protected

Calculates index in chunk from pointer address

반환값
Index position of object within chunk
주의
Helper for mapping pointers back to chunk indices

◆ del()

nbool by::watcher::del ( void * used,
ncnt sz )
overridevirtual

Returns life object back to available pool

반환값
true on success, false on failure
주의
Overrides chunk::del() to reclaim life objects for reuse

by::chunk(으)로부터 재구현되었습니다.

◆ get()

const life * by::watcher::get ( nidx n) const
overridenew

Allocates new life object from pre-allocated chunk

반환값
Pointer to available life object, or nullptr if chunk full
주의
Overrides chunk::new1() to provide life objects for instance tracking

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: