Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template rbtree_best_fit

boost::interprocess::rbtree_best_fit

Synopsis

// In header: <boost/interprocess/mem_algo/rbtree_best_fit.hpp>

template<typename MutexFamily, typename VoidPointer,  MemAlignment> 
class rbtree_best_fit {
public:
  // types
  typedef                                                    ;           // Shared mutex family used for the rest of the Interprocess framework. 
  typedef                                                    ;           // Pointer type to be used with the rest of the Interprocess framework. 
  typedef                                                    ;
  typedef  ;      
  typedef  ;            

  // construct/copy/destruct
  (, );
  ~();

  // public member functions
   ();
   ();
   () ;
   () ;
   ();
   ();
   ();
   ();
   ();
  template<typename T> 
     (, , 
                           , );
   (, 
                                , , , 
                                 = );
   () ;
   (, );

  // public static functions
   ();

  // public data members
  static  PayloadPerAllocation;
};

Description

This class implements an algorithm that stores the free nodes in a red-black tree to have logarithmic search/insert times.

rbtree_best_fit public construct/copy/destruct

  1. ( size,  extra_hdr_bytes);

    Constructor. "size" is the total size of the managed memory segment, "extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(rbtree_best_fit) offset that the allocator should not use at all.

  2. ~();
    Destructor.

rbtree_best_fit public member functions

  1.  ( nbytes);
    Allocates bytes, returns 0 if there is not more memory.
  2.  ( addr);
    Deallocates previously allocated bytes.
  3.  () ;
    Returns the size of the memory segment.
  4.  () ;
    Returns the number of free bytes of the segment.
  5.  ();

    Initializes to zero all the memory that's not in use. This function is normally used for security reasons.

  6.  ( extra_size);

    Increases managed memory in extra_size bytes more

  7.  ();
    Decreases managed memory as much as possible.
  8.  ();
    Returns true if all allocated memory has been deallocated.
  9.  ();

    Makes an internal sanity check and returns true if success

  10. template<typename T> 
       ( command, 
                              limit_size, 
                              prefer_in_recvd_out_size,  reuse);
  11.  ( command, 
                                   limit_object, 
                                   prefer_in_recvd_out_size, 
                                   reuse_ptr,  sizeof_object = );
  12.  ( ptr) ;
    Returns the size of the buffer previously allocated pointed by ptr.
  13.  ( nbytes,  alignment);

    Allocates aligned bytes, returns 0 if there is not more memory. Alignment must be power of 2

rbtree_best_fit public static functions

  1.  ( extra_hdr_bytes);
    Obtains the minimum size needed by the algorithm.

PrevUpHomeNext