|
Boost Users : |
Subject: Re: [Boost-users] [pool] singlton_pool::malloc returning bad address
From: Jonathan Leonard (v-jleonard_at_[hidden])
Date: 2009-07-02 18:25:14
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_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Steven Watanabe
Sent: Thursday, July 02, 2009 2:55 PM
To: boost-users_at_[hidden]
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_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net