19 static constexpr ncnt MIN_SZ = 20;
22 explicit chunk(ncnt blockSz = 1, ncnt sz = MIN_SZ);
26 void* operator[](nidx n);
27 const void* operator[](nidx n)
const BY_CONST_FUNC(
operator[](n));
30 void* get(nidx n) {
return _get(n); }
33 void* new1()
override;
34 nbool del(
void* used, ncnt)
override;
36 ncnt len()
const override;
37 ncnt size()
const override;
41 nbool has(
const instance& it)
const override;
47 void*
_get(nidx n)
override;
49 const nuchar* _getHeap() const BY_CONST_FUNC(_getHeap())
50 nbool _resize(ncnt newSz);
54 const nuchar* _getEOB() const BY_CONST_FUNC(_getEOB())
56 nbool _index(nidx start);
57 ncnt _getRealBlkSize();
58 void* _allocHeap(ncnt new_sz);
59 nbool _freeHeap(nuchar** heap);
Abstract allocator interface for memory management.
Definition: allocator.hpp:12
Memory chunk for block-based allocation.
Definition: chunk.hpp:12
void * _get(nidx n) override
Base class for all managed instances in memlite system.
Definition: instance.hpp:20
Memory watcher for tracking instance lifecycle and allocation.
Definition: watcher.hpp:13