Macaulay2 Engine
Loading...
Searching...
No Matches
MonomialMemorySpace Class Reference

Bump-pointer arena for monomial storage, backed by a memt::Arena. More...

#include <monomial-sets.hpp>

Public Member Functions

 MonomialMemorySpace ()
std::pair< int *, int * > alloc (int size)
intallocate (int size)
void popLastAlloc (int *m)
void shrinkLastAlloc (int *m)
size_t size () const
void freeAllAllocs ()
void freeAllAllocsAndBackingMemory ()

Private Attributes

size_t mCount
memt::Arena mArena

Detailed Description

Bump-pointer arena for monomial storage, backed by a memt::Arena.

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

Hands out contiguous int ranges via alloc(size) (returns [begin, end)). Supports LIFO popLastAlloc and shrinkLastAlloc so a monomial can be allocated at its maximum length, written in place, then trimmed — the pattern the variable-size Collection classes use for intern-or-pop. The whole arena is reset with freeAllAllocs or released to the OS with freeAllAllocsAndBackingMemory.

Definition at line 82 of file monomial-sets.hpp.


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