Arena created for project mobi-av disponibilized in github to usage
Benchmark using google-benchmark
Tests using google-test
for compile benchmark and tests
mkdir build
cd build
cmake ..
make
#include "include/arena.hpp"
Arena fast(3*sizeof(int)); // allocate 3 blocks long from an length int
int main( void )
{
// requests blocks
int *p1 = (int*)fast.req(sizeof(int));
*p1 = 100;
int *p2 = (int*)fast.req(sizeof(int));
*p2 = 400;
int *p3 = (int*)fast.req(sizeof(int));
*p3 = 400;
return 0;
}
Functions extras :
void realloc(unsigned int ); // allocate more space in the arena
obs: when you make a request for more space the previously created arena will be completely erased and the requested space will be allocated
void dell(); // will put the pointer to the beginning of the arena
unsigned int fquantity(); // will bring the value of available space in the arena