Macaulay2 Engine
Loading...
Searching...
No Matches
allocator.hpp File Reference

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

Detailed Description

BIBasis::FastAllocator — per-size-class slab allocator for BIBasis's small objects.

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

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.

See also
bibasis.cpp
polynom.hpp
monom.hpp

Definition in file allocator.hpp.