SpiecsEngine
 
Loading...
Searching...
No Matches
Spices::MemoryPool Class Reference

MemoryPool Class. More...

#include <MemoryPool.h>

Static Public Member Functions

static void * Alloc (size_t size)
 Alloc memory entry point.
 
static void Free (void *ptr)
 Free memory entry point.
 
static void *& PointerSpace (void *obj)
 Get object first 4/8 bytes as a pointer.
 
static size_t AlignUp (size_t size)
 Align up memory bytes.
 
static size_t Index (size_t size)
 Determine which freelist should process the memory block with given bytes.
 
static size_t Bytes (size_t index)
 Determine how much bytes freelist should process the memory block with given index.
 
static size_t GetNBlocksLimit (size_t size)
 Get count of blocks limit by tc align up bytes.
 
static size_t GetPages (size_t size)
 Get pages count by given bytes.
 

Static Public Attributes

static constexpr size_t FREE_LIST_NUM = 208
 Number of freelist. equals to 16 + 56 + 56 + 56 + 24.
 
static constexpr size_t MAX_BYTES = 256 * 1024
 Only allowed 256KB allocated memory one time in tc.
 
static constexpr size_t PAGE_NUM = 129
 number of pages in pc (1M).
 
static constexpr size_t PAGE_SHIFT = 13
 8KB in a page.
 

Detailed Description

MemoryPool Class.

Definition at line 21 of file MemoryPool.h.


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