1 /* Copyright (C) 2011 John Maddock 2 * 3 * Use, modification and distribution is subject to the 4 * Boost Software License, Version 1.0. (See accompanying 5 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 6 */ 7 8 // 9 // Verify that if malloc/free are macros that everything still works OK: 10 // 11 12 #include <functional> 13 #include <new> 14 #include <cstddef> 15 #include <cstdlib> 16 #include <exception> 17 #include <algorithm> 18 #include <boost/limits.hpp> 19 #include <iostream> 20 #include <locale> 21 22 namespace std{ 23 24 void* undefined_poisoned_symbol1(unsigned x); 25 void undefined_poisoned_symbol2(void* x); 26 27 } 28 29 #define malloc(x) undefined_poisoned_symbol1(x) 30 #define free(x) undefined_poisoned_symbol2(x) 31 32 #include <boost/pool/pool.hpp> 33 #include <boost/pool/object_pool.hpp> 34 #include <boost/pool/pool_alloc.hpp> 35 #include <boost/pool/singleton_pool.hpp> 36 37 template class boost::object_pool<int, boost::default_user_allocator_new_delete>; 38 template class boost::object_pool<int, boost::default_user_allocator_malloc_free>; 39 40 template class boost::pool<boost::default_user_allocator_new_delete>; 41 template class boost::pool<boost::default_user_allocator_malloc_free>; 42 43 template class boost::pool_allocator<int, boost::default_user_allocator_new_delete>; 44 template class boost::pool_allocator<int, boost::default_user_allocator_malloc_free>; 45 template class boost::fast_pool_allocator<int, boost::default_user_allocator_new_delete>; 46 template class boost::fast_pool_allocator<int, boost::default_user_allocator_malloc_free>; 47 48 template class boost::simple_segregated_storage<unsigned>; 49 50 template class boost::singleton_pool<int, 32>; 51