Index: boost/pool/singleton_pool.hpp =================================================================== --- boost/pool/singleton_pool.hpp (revision 67283) +++ boost/pool/singleton_pool.hpp (working copy) @@ -18,8 +18,17 @@ // boost::details::pool::guard #include +#include +#include +#include + namespace boost { +inline int get_id() { + static int result = 0; + return result++; +} + // // The singleton_pool class allows other pool interfaces for types of the same // size to share the same pool @@ -64,11 +73,26 @@ details::pool::guard g(p); return p.p.ordered_malloc(); } + static int id() { static int result = get_id(); return result; } static void * ordered_malloc(const size_type n) { pool_type & p = singleton::instance(); details::pool::guard g(p); - return p.p.ordered_malloc(n); + + static bool is_typedefed = false; + if(!is_typedefed) { + is_typedefed = true; + std::cout << "typedef " << boost::units::detail::demangle(typeid(singleton_pool).name()) + << "pool_type" << id() << ";\n"; + } + std::cout << "tmp = pool_type" << id() << "::ordered_malloc(" << n << ");" << std::endl; + void* result = p.p.ordered_malloc(n); + static std::set known; + if(known.insert(result).second) { + std::cout << "void* "; + } + std::cout << "p" << result << " = tmp;\n"; + return result; } static bool is_from(void * const ptr) { @@ -98,6 +122,7 @@ { pool_type & p = singleton::instance(); details::pool::guard g(p); + std::cout << "pool_type" << id() << "::ordered_free(p" << ptr << ", " << n << ");" << std::endl; p.p.ordered_free(ptr, n); } static bool release_memory()