Re: [Boost-bugs] [Boost C++ Libraries] #3349: ordered_malloc not always keeps the free list ordered.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3349: ordered_malloc not always keeps the free list ordered.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-08-17 21:56:29


#3349: ordered_malloc not always keeps the free list ordered.
--------------------------------------------------+-------------------------
 Reporter: Xiaohan Wang <wangxiaohan@…> | Owner: cnewbold
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: pool
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: pool, ordered_malloc, add_block |
--------------------------------------------------+-------------------------

Comment(by Xiaohan Wang <wangxiaohan@…>):

 BTW, I wrote a simple program to show this. The variable
 "any_memory_released" is false after the release because the free list is
 out of order. If we change the "add_block" to "add_ordered_block" then
 "any_memory_released" is true.

 {{{
 int main()
 {
     pool<> p(256, 4);

     void* pBlock1 = p.ordered_malloc( 1 );
     void* pBlock2 = p.ordered_malloc( 4 );

     p.ordered_free( pBlock1 );

     bool any_memory_released = p.release_memory();

     cout << "Any memory released? " << any_memory_released << endl;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3349#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC