SpiecsEngine
 
Loading...
Searching...
No Matches
scl::free_list Class Reference

Free list for memory pool. More...

#include <FreeList.h>

Public Member Functions

 free_list ()
 Constructor Function.
 
virtual ~free_list ()=default
 Destructor Function.
 
void Push (void *obj)
 Recycle a object memory to this free list.
 
void * Pop ()
 Pop a unused memory block from this free list.
 
bool Empty () const
 Determine if this list is empty.
 
const size_t ApplyforNBlocks () const
 Get m_NBlocksAppliedFor reference.
 
void IncreaseInNextApplyFor ()
 Increase count of blocks in next apply for.
 
const size_t Size () const
 Get this freelist spare size.
 
void PushRange (void *start, void *end, size_t size)
 Push other free list to this free list.
 
void PopRange (void *&start, void *&end, size_t size)
 Pop unused memory blocks from this free list.
 
const void * Begin () const
 Get current pointer.
 
void *& Begin ()
 Get current pointer (no const & reference version).
 
void *& End ()
 Get end pointer (no const & reference version).
 

Private Attributes

void * m_EndPointer
 end pointer;
 
void * m_Freelist
 current pointer.
 
size_t m_NBlocksAppliedFor
 count of blocks applied for in next time.
 
size_t m_Size
 freelist spare size.
 

Detailed Description

Free list for memory pool.

Attention
pushed object must large that 8B, for we want store a pointer in there.

Definition at line 15 of file FreeList.h.


The documentation for this class was generated from the following files: