Macaulay2 Engine
Loading...
Searching...
No Matches
BIBasis::FastAllocator Class Reference

Slab allocator handing out fixed-size blocks for one BIBasis type per instance. More...

#include <allocator.hpp>

Public Member Functions

 FastAllocator (const size_t blockSize)
 ~FastAllocator ()
void * Allocate ()
void Free (void *pointer)

Private Member Functions

void ExpandMemory ()

Private Attributes

const size_t MemoryPageSize
const size_t TSize
const size_t PageSize
void ** FreeBlock

Detailed Description

Slab allocator handing out fixed-size blocks for one BIBasis type per instance.

Note
AI-generated documentation. Verify against the source before relying on it.

Allocates MemoryPageSize-byte pages from the system heap and carves each page into TSize-byte cells (typically the size of one VarsListNode or MonomDL etc.). Free cells are threaded into a FreeBlock LIFO so Allocate() / Free(p) are O(1) and avoid hitting malloc on the BIBasis inner loop. ExpandMemory() grabs a fresh page when the free list is empty.

Definition at line 56 of file allocator.hpp.


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