00001 /* 00002 * See the dyninst/COPYRIGHT file for copyright information. 00003 * 00004 * We provide the Paradyn Tools (below described as "Paradyn") 00005 * on an AS IS basis, and do not warrant its validity or performance. 00006 * We reserve the right to update, modify, or discontinue this 00007 * software at any time. We shall have no obligation to supply such 00008 * updates or modifications or any other form of support to you. 00009 * 00010 * By your use of Paradyn, you understand and agree that we (or any 00011 * other person or entity with proprietary rights in Paradyn) are 00012 * under no obligation to provide either maintenance services, 00013 * update services, notices of latent defects, or correction of 00014 * defects for Paradyn. 00015 * 00016 * This library is free software; you can redistribute it and/or 00017 * modify it under the terms of the GNU Lesser General Public 00018 * License as published by the Free Software Foundation; either 00019 * version 2.1 of the License, or (at your option) any later version. 00020 * 00021 * This library is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 * Lesser General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU Lesser General Public 00027 * License along with this library; if not, write to the Free Software 00028 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00029 */ 00030 #if !defined(POOL_ALLOCATORS_H) 00031 #define POOL_ALLOCATORS_H 00032 00033 00034 #include <boost/pool/pool_alloc.hpp> 00035 #include <set> 00036 #include <vector> 00037 00038 template <typename T> 00039 struct unlocked_fast_alloc 00040 { 00041 typedef boost::fast_pool_allocator<T, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex> type; 00042 }; 00043 00044 template <typename T> 00045 struct unlocked_pool_alloc 00046 { 00047 typedef boost::pool_allocator<T, boost::default_user_allocator_new_delete, boost::details::pool::null_mutex> type; 00048 }; 00049 00050 template <typename T> 00051 struct pooled_set 00052 { 00053 typedef std::set<T, typename std::less<T>, typename unlocked_fast_alloc<T>::type > type; 00054 }; 00055 00056 00057 template <typename T> 00058 struct pooled_vector 00059 { 00060 typedef std::vector<T, typename unlocked_pool_alloc<T>::type > type; 00061 }; 00062 00063 00064 00065 00066 #endif //!defined(POOL_ALLOCATORS_H)
1.6.1