|
Macaulay2 Engine
|
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) |
| int * | allocate (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 |
Bump-pointer arena for monomial storage, backed by a memt::Arena.
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.