d8f97dc508bbeb29d77d6441da65d21e838500ae
[winnie] / src / shalloc.cc
1 #include <map>
2 #include <stdlib.h>
3
4 #include "shalloc.h"
5
6 #define POOL_SIZE 16777216
7 #define BLOCK_SIZE 1024
8
9 static unsigned char *pool;
10 static std::map<unsigned char*, size_t> alloc_sizes;
11 //address size
12
13 bool init_shared_memory()
14 {
15         if(!(pool = (unsigned char *)malloc(POOL_SIZE))) {
16                 return false;
17         }
18 }
19
20 void destroy_shared_memory()
21 {
22         //TODO print statistics
23         free(pool);
24 }
25
26 // an zitaei 45 mb 8a vriskw posa blocks kai meta
27 // 8a psaxnw tosa sunexomena bits sto bitmap
28 // an den exei return 0
29 // pool[arxidi]