|
Macaulay2 Engine
|
BIBasis::FastAllocator — per-size-class slab allocator for BIBasis's small objects. More...
Go to the source code of this file.
Classes | |
| class | BIBasis::FastAllocator |
| Slab allocator handing out fixed-size blocks for one BIBasis type per instance. More... | |
Namespaces | |
| namespace | BIBasis |
BIBasis::FastAllocator — per-size-class slab allocator for BIBasis's small objects.
Declares the slab pool that supplies storage for the millions of tiny Monom, Polynom, and Triple records the involutive- basis algorithm churns through. Each FastAllocator instance is bound to a single fixed blockSize at construction and maintains a free-list of that-sized chunks carved out of large memory pages; Allocate() pops the head of the free-list (and calls ExpandMemory() to slab in a new page if the list is empty), Free() pushes back, both inlined for the inner loop.
Memory is never returned to the OS — the slabs persist for the life of the allocator and are reclaimed only on process exit. The subsystem deliberately bypasses M2's Boehm GC and the engine's our_new_delete pattern; BIBasis classes opt in by overloading operator new / operator delete to route through a static FastAllocator for their size class.
Definition in file allocator.hpp.