Skip to content

In computer science, region-based memory management is a type of memory management in which each allocated object is assigned to a region.

License

Notifications You must be signed in to change notification settings

rem0obb/mobi-arena

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arena-mobi

Arena created for project mobi-av disponibilized in github to usage

Benchmark

Benchmark using google-benchmark

BenchMark

Tests

Tests using google-test

Test

for compile benchmark and tests

  mkdir build
  cd build
  cmake ..
  make

Usage Arena

  #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

Diagrama

arenaDigrama

About

In computer science, region-based memory management is a type of memory management in which each allocated object is assigned to a region.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published