__gnu_cxx::free_list Class Reference

The free list class for managing chunks of memory to be given to and returned by the bitmap_allocator. More...

#include <bitmap_allocator.h>

Inheritance diagram for __gnu_cxx::free_list:

__gnu_cxx::bitmap_allocator< _Tp > List of all members.

Public Member Functions

void _M_insert (size_t *__addr) throw ()
 This function returns the block of memory to the internal free list.
size_t * _M_get (size_t __sz) throw (std::bad_alloc)
 This function gets a block of memory of the specified size from the free list.
void _M_clear ()
 This function just clears the internal Free List, and gives back all the memory to the OS.

Private Types

typedef size_t * value_type
typedef balloc::__mini_vector<
value_type
vector_type
typedef vector_type::iterator iterator

Private Member Functions

vector_type_M_get_free_list ()
void _M_validate (size_t *__addr) throw ()
 Performs validation of memory based on their size.
bool _M_should_i_give (size_t __block_size, size_t __required_size) throw ()
 Decides whether the wastage of memory is acceptable for the current memory request and returns accordingly.

Classes

struct  _LT_pointer_compare

Detailed Description

The free list class for managing chunks of memory to be given to and returned by the bitmap_allocator.

Definition at line 706 of file bitmap_allocator.h.


Member Typedef Documentation

typedef vector_type::iterator __gnu_cxx::free_list::iterator [private]

Definition at line 710 of file bitmap_allocator.h.

typedef size_t* __gnu_cxx::free_list::value_type [private]

Reimplemented in __gnu_cxx::bitmap_allocator< _Tp >.

Definition at line 708 of file bitmap_allocator.h.

typedef balloc::__mini_vector<value_type> __gnu_cxx::free_list::vector_type [private]

Definition at line 709 of file bitmap_allocator.h.


Member Function Documentation

void __gnu_cxx::free_list::_M_clear (  ) 

This function just clears the internal Free List, and gives back all the memory to the OS.

size_t* __gnu_cxx::free_list::_M_get ( size_t  __sz  )  throw (std::bad_alloc)

This function gets a block of memory of the specified size from the free list.

Parameters:
__sz The size in bytes of the memory required.
Returns:
A pointer to the new memory block of size at least equal to that requested.

Referenced by __gnu_cxx::bitmap_allocator< _Tp >::_S_refill_pool().

vector_type& __gnu_cxx::free_list::_M_get_free_list (  )  [inline, private]

Definition at line 730 of file bitmap_allocator.h.

Referenced by _M_validate().

void __gnu_cxx::free_list::_M_insert ( size_t *  __addr  )  throw () [inline]

This function returns the block of memory to the internal free list.

Parameters:
__addr The pointer to the memory block that was given by a call to the _M_get function.

Definition at line 813 of file bitmap_allocator.h.

References _M_validate().

Referenced by __gnu_cxx::bitmap_allocator< _Tp >::_M_deallocate_single_object().

bool __gnu_cxx::free_list::_M_should_i_give ( size_t  __block_size,
size_t  __required_size 
) throw () [inline, private]

Decides whether the wastage of memory is acceptable for the current memory request and returns accordingly.

Parameters:
__block_size The size of the block available in the free list.
__required_size The required size of the memory block.
Returns:
true if the wastage incurred is acceptable, else returns false.

Definition at line 793 of file bitmap_allocator.h.

void __gnu_cxx::free_list::_M_validate ( size_t *  __addr  )  throw () [inline, private]

Performs validation of memory based on their size.

Parameters:
__addr The pointer to the memory block to be validated.
Validates the memory block passed to this function and appropriately performs the action of managing the free list of blocks by adding this block to the free list or deleting this or larger blocks from the free list.

Definition at line 747 of file bitmap_allocator.h.

References __gnu_cxx::balloc::__lower_bound(), _M_get_free_list(), __gnu_cxx::balloc::__mini_vector< _Tp >::back(), __gnu_cxx::balloc::__mini_vector< _Tp >::begin(), __gnu_cxx::balloc::__mini_vector< _Tp >::end(), __gnu_cxx::balloc::__mini_vector< _Tp >::insert(), __gnu_cxx::balloc::__mini_vector< _Tp >::pop_back(), and __gnu_cxx::balloc::__mini_vector< _Tp >::size().

Referenced by _M_insert().


The documentation for this class was generated from the following file:
Generated on Tue Feb 2 16:57:52 2010 for GNU C++ STL by  doxygen 1.4.7