|
Boost : |
From: Michael Marcin (mike_at_[hidden])
Date: 2007-01-25 00:44:41
Michael Marcin wrote:
> Steven Watanabe wrote:
>> AMDG
>>
>> <snip>
>>
>> Iteration seems like a good solution.
>>
>> <snip>
>>
>
> Thanks! I'll give it a shot.
>
Well I tried it out, seemed to work fine except for the original problem.
I added one extra function to the object_pool class:
void destroy( const iterator& it )
{
destroy( static_cast<T*>(static_cast<void*>(it.i)) );
}
And then invoked my DestroyAll function with some items allocated from
the pool which looks like:
boost::object_pool<Object>::iterator it = m_object_pool.begin();
while( it != m_object_pool.end() )
{
m_object_pool.destroy( it++ );
}
The second iteration loops infinitely inside of
template <typename SizeType>
void * simple_segregated_storage<SizeType>::find_prev(void * const ptr);
Not quite sure why.
Thanks,
Michael Marcin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk