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
10 #ifndef AesalonStorage_Mempool_H
11 #define AesalonStorage_Mempool_H
16 #include <ext/pool_allocator.h>
18 #define AesalonPoolAlloc(type, pointer, object) \
20 __gnu_cxx::__pool_alloc<type> allocator; \
21 pointer = allocator.allocate(1); \
22 allocator.construct(pointer, object); \
25 #define AesalonPoolDestroy(type, pointer) \
27 __gnu_cxx::__pool_alloc<type> allocator; \
28 allocator.destroy(pointer); \
31 #define AesalonPoolArray(type, pointer, size) \
33 __gnu_cxx::__pool_alloc<type> allocator; \
34 pointer = allocator.allocate(size); \