Gröbner basis project
Codebase for research into Gröbner basis computation
Grading_Order_Data_Allocator< TYPE > Class Template Reference

special memory pool allocator for Grevlex_Order_Data and WGrevlex_Order_Data More...

#include <goda.hpp>

Public Member Functions

 Grading_Order_Data_Allocator (NVAR_TYPE n)
 sets allocator up for blocks of \(n\) gradings/variables.
 
 ~Grading_Order_Data_Allocator ()
 releases all memory — you'd better have freed yours!
 
goda_block< TYPE > * allocate_new_block ()
 allocates a new superblock of almost 10000 blocks
 
TYPE * get_new_block ()
 allocates and returns a block of memory
 
void return_used_block (TYPE *freed_block)
 returns a block of memory that is no longer needed to the pool
 

Protected Attributes

goda_block< TYPE > * big_blocks
 pointer to the superblock of all blocks
 
goda_block< TYPE > * block
 pointer to the next free block
 
const unsigned data_size
 how many words to step from one block to the next
 

Detailed Description

template<typename TYPE>
class Grading_Order_Data_Allocator< TYPE >

special memory pool allocator for Grevlex_Order_Data and WGrevlex_Order_Data

Author
John Perry
Date
2016

This is a quick-n-dirty memory pool allocator for Grevlex_Order_Data and WGrevlex_Order_Data. It isn't quite \(O(1)\) but the plan is to fix that eventually (I have to locate my notes from class).

Warning
This is initialized to a certain number of variables, which cannot change. If you want to do this for a different number of variables, create another allocator.

Definition at line 50 of file goda.hpp.


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