Fixed buildsystem slightly, started re=implementation of the RTree.
[aesalon.git] / include / storage / Mempool.h
blob43f1d8a2367f0ef0c13813e54228cbf801d88373
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/storage/Mempool.h
8 */
10 #ifndef AesalonStorage_Mempool_H
11 #define AesalonStorage_Mempool_H
13 #include <stdint.h>
14 #include <vector>
16 #include <ext/pool_allocator.h>
18 #define AesalonPoolAlloc(type, pointer, object) \
19 do { \
20 __gnu_cxx::__pool_alloc<type> allocator; \
21 pointer = allocator.allocate(1); \
22 allocator.construct(pointer, object); \
23 } while(0)
25 #define AesalonPoolDestroy(type, pointer) \
26 do { \
27 __gnu_cxx::__pool_alloc<type> allocator; \
28 allocator.destroy(pointer); \
29 } while(0)
31 #define AesalonPoolArray(type, pointer, size) \
32 do { \
33 __gnu_cxx::__pool_alloc<type> allocator; \
34 pointer = allocator.allocate(size); \
35 } while(0)
38 #endif