InstructionAPI optimization pass 1:
[dyninst.git] / common / h / pool_allocators.h
1 #if !defined(POOL_ALLOCATORS_H)
2 #define POOL_ALLOCATORS_H
3
4
5 #include <boost/pool/pool_alloc.hpp>
6 #include <set>
7 #include <vector>
8
9 template <typename T>
10 struct unlocked_fast_alloc
11 {
12   typedef boost::fast_pool_allocator<T, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex> type;
13 };
14
15 template <typename T>
16 struct unlocked_pool_alloc
17 {
18   typedef boost::pool_allocator<T, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex> type;
19 };
20
21 template <typename T>
22 struct pooled_set
23 {
24   typedef std::set<T, typename std::less<T>, typename unlocked_fast_alloc<T>::type > type;
25 };
26
27
28 template <typename T>
29 struct pooled_vector
30 {
31   typedef std::vector<T, typename unlocked_pool_alloc<T>::type > type;
32 };
33
34
35
36
37 #endif //!defined(POOL_ALLOCATORS_H)