|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_ALLOC_BLOCK_ALLOCATOR_WITH_GC
22 #define ELM_ALLOC_BLOCK_ALLOCATOR_WITH_GC
24 #include <elm/alloc/DefaultAllocator.h>
25 #include <elm/data/Vector.h>
26 #include <elm/util/BitVector.h>
27 #include <elm/util/Flags.h>
39 inline bool isSync() {
return flags(SYNC); }
52 void free(
void *block);
58 virtual void endGC(
void);
91 #endif // ELM_ALLOC_BLOCK_ALLOCATOR_WITH_GC
virtual void destroy(T *p)
Definition: BlockAllocatorWithGC.h:82
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
free_t * free_list
Definition: BlockAllocatorWithGC.h:62
BlockAllocatorWithGC(t::size chunk_size=1<< 20)
Definition: BlockAllocatorWithGC.h:80
free_t * next
Definition: BlockAllocatorWithGC.h:61
int freeCount(void) const
Definition: BlockAllocatorWithGC.h:46
void * allocate(void)
Definition: alloc_BlockAllocatorWithGC.cpp:69
int usedCount(void) const
Definition: BlockAllocatorWithGC.h:48
void free(void *block)
Definition: alloc_BlockAllocatorWithGC.cpp:117
void clear(int i)
Definition: Flags.h:34
void setAsync()
Definition: BlockAllocatorWithGC.h:41
bool mark(T *b)
Definition: BlockAllocatorWithGC.h:86
void setSync()
Definition: BlockAllocatorWithGC.h:40
virtual void destroy(void *p)
Definition: alloc_BlockAllocatorWithGC.cpp:236
void destroy(void *p) override
Definition: BlockAllocatorWithGC.h:83
bool needsCollect() const
Definition: BlockAllocatorWithGC.h:38
bool isSync()
Definition: BlockAllocatorWithGC.h:39
virtual void endGC(void)
Definition: alloc_BlockAllocatorWithGC.cpp:227
Definition: BlockAllocatorWithGC.h:61
Definition: BlockAllocatorWithGC.h:32
struct elm::AbstractBlockAllocatorWithGC::free_t free_t
uint64 size
Definition: arch.h:35
T * allocate(void)
Definition: BlockAllocatorWithGC.h:81
unsigned char uint8
Definition: arch.h:27
virtual ~AbstractBlockAllocatorWithGC(void)
Definition: alloc_BlockAllocatorWithGC.cpp:48
virtual void collect(void)=0
t::size blockSize(void) const
Definition: BlockAllocatorWithGC.h:44
AbstractBlockAllocatorWithGC(t::size block_size, t::size chunk_size=1<< 20)
Definition: alloc_BlockAllocatorWithGC.cpp:37
int free_cnt
Definition: BlockAllocatorWithGC.h:63
unsigned int uint32
Definition: arch.h:31
t::size chunkSize(void) const
Definition: BlockAllocatorWithGC.h:45
int totalCount(void) const
Definition: alloc_BlockAllocatorWithGC.cpp:244
Definition: BitVector.h:31
void set(int i)
Definition: Flags.h:33
Definition: BlockAllocatorWithGC.h:78
bool mark(void *ptr)
Definition: alloc_BlockAllocatorWithGC.cpp:191
void collectGarbage(void)
Definition: alloc_BlockAllocatorWithGC.cpp:124
virtual void beginGC(void)
Definition: alloc_BlockAllocatorWithGC.cpp:218