
AMDG I'm just using the default specialization like such: struct scalable_alloc_tag {}; T* ret = (T*)boost::singleton_pool<scalable_alloc_tag, sizeof(T)>::malloc(); if (!ret) throw std::bad_alloc(); new (ret) T(); Yep, malloc and free are being called simultaneously from the main thread and worker threads. The docs say that it is thread-safe "if there is only one thread running before main() begins and after main() ends" [which is our case]. A rough calculation shows that approx 8.64 billion alloc/free pairs occurred before the crash. Thank you, Jonathan -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Thursday, July 02, 2009 2:55 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [pool] singlton_pool::malloc returning bad address AMDG Jonathan Leonard wrote:
I'm only calling malloc() and free(). I'm also using tbb's scalable_allocator for non- O-O allocations (if that would matter).
This is with boost 1.37.
I don't see any recent changes in the trunk that are likely to affect this problem. I've been running a combination of malloc/free for the last 2 hours and it hasn't shown any problems. What specialization of singleton_pool are you using exactly? Can malloc and free be called concurrently? Can you guess approximately how many calls to malloc and free need to be made on average before it crashes? I haven't seen anything suspicious yet looking through the pool code... In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users