__gnu_cxx::__mt_alloc< _Tp > Class Template Reference

#include <mt_allocator.h>

List of all members.

Public Types

typedef size_t size_type
typedef ptrdiff_t difference_type
typedef _Tp * pointer
typedef const _Tp * const_pointer
typedef _Tp & reference
typedef const _Tp & const_reference
typedef _Tp value_type

Public Member Functions

 __mt_alloc () throw ()
 __mt_alloc (const __mt_alloc &) throw ()
template<typename _Tp1>  __mt_alloc (const __mt_alloc< _Tp1 > &obj) throw ()
 ~__mt_alloc () throw ()
pointer address (reference __x) const
const_pointer address (const_reference __x) const
size_type max_size () const throw ()
void construct (pointer __p, const _Tp &__val)
void destroy (pointer __p)
pointer allocate (size_type __n, const void *=0)
void deallocate (pointer __p, size_type __n)

Private Types

typedef unsigned short int _Binmap_type

Static Private Member Functions

void _S_initialize ()
const _Tune _S_get_options ()
void _S_set_options (_Tune __t)
size_t _S_get_thread_id ()

Static Private Attributes

bool _S_init = false
_Tune _S_options
_Binmap_type_S_binmap
_Bin_record *volatile _S_bin
size_t _S_bin_size = 1


Detailed Description

template<typename _Tp>
class __gnu_cxx::__mt_alloc< _Tp >

This is a fixed size (power of 2) allocator which - when compiled with thread support - will maintain one freelist per size per thread plus a "global" one. Steps are taken to limit the per thread freelist sizes (by returning excess back to "global").

Further details: http://gcc.gnu.org/onlinedocs/libstdc++/ext/mt_allocator.html

Definition at line 57 of file mt_allocator.h.


Member Typedef Documentation

template<typename _Tp>
typedef unsigned short int __gnu_cxx::__mt_alloc< _Tp >::_Binmap_type [private]
 

Definition at line 202 of file mt_allocator.h.

Referenced by __gnu_cxx::__mt_alloc< _Tp >::_S_initialize().

template<typename _Tp>
typedef const _Tp* __gnu_cxx::__mt_alloc< _Tp >::const_pointer
 

Definition at line 63 of file mt_allocator.h.

template<typename _Tp>
typedef const _Tp& __gnu_cxx::__mt_alloc< _Tp >::const_reference
 

Definition at line 65 of file mt_allocator.h.

template<typename _Tp>
typedef ptrdiff_t __gnu_cxx::__mt_alloc< _Tp >::difference_type
 

Definition at line 61 of file mt_allocator.h.

template<typename _Tp>
typedef _Tp* __gnu_cxx::__mt_alloc< _Tp >::pointer
 

Definition at line 62 of file mt_allocator.h.

template<typename _Tp>
typedef _Tp& __gnu_cxx::__mt_alloc< _Tp >::reference
 

Definition at line 64 of file mt_allocator.h.

template<typename _Tp>
typedef size_t __gnu_cxx::__mt_alloc< _Tp >::size_type
 

Definition at line 60 of file mt_allocator.h.

template<typename _Tp>
typedef _Tp __gnu_cxx::__mt_alloc< _Tp >::value_type
 

Definition at line 66 of file mt_allocator.h.


Constructor & Destructor Documentation

template<typename _Tp>
__gnu_cxx::__mt_alloc< _Tp >::__mt_alloc  )  throw () [inline]
 

Definition at line 72 of file mt_allocator.h.

template<typename _Tp>
__gnu_cxx::__mt_alloc< _Tp >::__mt_alloc const __mt_alloc< _Tp > &   )  throw () [inline]
 

Definition at line 77 of file mt_allocator.h.

template<typename _Tp>
template<typename _Tp1>
__gnu_cxx::__mt_alloc< _Tp >::__mt_alloc const __mt_alloc< _Tp1 > &  obj  )  throw () [inline]
 

Definition at line 83 of file mt_allocator.h.

template<typename _Tp>
__gnu_cxx::__mt_alloc< _Tp >::~__mt_alloc  )  throw () [inline]
 

Definition at line 88 of file mt_allocator.h.


Member Function Documentation

template<typename _Tp>
const _Tune __gnu_cxx::__mt_alloc< _Tp >::_S_get_options  )  [inline, static, private]
 

Definition at line 190 of file mt_allocator.h.

References __gnu_cxx::__mt_alloc< _Tp >::_S_options.

template<typename _Tp>
size_t __gnu_cxx::__mt_alloc< _Tp >::_S_get_thread_id  )  [static, private]
 

Definition at line 624 of file mt_allocator.h.

References __gthread_active_p(), __gthread_getspecific(), __gthread_mutex_lock(), __gthread_mutex_unlock(), and __gthread_setspecific().

Referenced by __gnu_cxx::__mt_alloc< _Tp >::allocate(), and __gnu_cxx::__mt_alloc< _Tp >::deallocate().

template<typename _Tp>
void __gnu_cxx::__mt_alloc< _Tp >::_S_initialize  )  [static, private]
 

Definition at line 489 of file mt_allocator.h.

References __gthread_active_p(), __gthread_key_create(), __GTHREAD_MUTEX_INIT, __gthread_mutex_t, __gnu_cxx::__mt_alloc< _Tp >::_Binmap_type, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_align, __gnu_cxx::__mt_alloc< _Tp >::_Bin_record::_M_first, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_force_new, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_max_bytes, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_max_threads, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_min_bin, __gnu_cxx::__mt_alloc< _Tp >::_S_bin_size, __gnu_cxx::__mt_alloc< _Tp >::_S_binmap, __gnu_cxx::__mt_alloc< _Tp >::_S_init, and __gnu_cxx::__mt_alloc< _Tp >::_S_options.

Referenced by __gnu_cxx::__mt_alloc< _Tp >::allocate().

template<typename _Tp>
void __gnu_cxx::__mt_alloc< _Tp >::_S_set_options _Tune  __t  )  [inline, static, private]
 

Definition at line 194 of file mt_allocator.h.

References __gnu_cxx::__mt_alloc< _Tp >::_S_init, and __gnu_cxx::__mt_alloc< _Tp >::_S_options.

template<typename _Tp>
const_pointer __gnu_cxx::__mt_alloc< _Tp >::address const_reference  __x  )  const [inline]
 

Definition at line 95 of file mt_allocator.h.

template<typename _Tp>
pointer __gnu_cxx::__mt_alloc< _Tp >::address reference  __x  )  const [inline]
 

Definition at line 91 of file mt_allocator.h.

template<typename _Tp>
__mt_alloc< _Tp >::pointer __gnu_cxx::__mt_alloc< _Tp >::allocate size_type  __n,
const void *  = 0
 

Definition at line 280 of file mt_allocator.h.

References __gthread_active_p(), __gthread_mutex_lock(), __gthread_mutex_unlock(), __gthread_once(), __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_align, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_chunk_size, __gnu_cxx::__mt_alloc< _Tp >::_Bin_record::_M_first, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_force_new, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_max_bytes, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_min_bin, __gnu_cxx::__mt_alloc< _Tp >::_Block_record::_M_next, __gnu_cxx::__mt_alloc< _Tp >::_S_binmap, __gnu_cxx::__mt_alloc< _Tp >::_S_get_thread_id(), __gnu_cxx::__mt_alloc< _Tp >::_S_init, __gnu_cxx::__mt_alloc< _Tp >::_S_initialize(), and __gnu_cxx::__mt_alloc< _Tp >::_S_options.

template<typename _Tp>
void __gnu_cxx::__mt_alloc< _Tp >::construct pointer  __p,
const _Tp &  __val
[inline]
 

Definition at line 105 of file mt_allocator.h.

References __gnu_cxx::__val.

template<typename _Tp>
void __gnu_cxx::__mt_alloc< _Tp >::deallocate pointer  __p,
size_type  __n
 

Definition at line 418 of file mt_allocator.h.

References __gthread_active_p(), __gthread_mutex_lock(), __gthread_mutex_unlock(), __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_align, __gnu_cxx::__mt_alloc< _Tp >::_Bin_record::_M_first, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_force_new, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_freelist_headroom, __gnu_cxx::__mt_alloc< _Tp >::_Tune::_M_max_bytes, __gnu_cxx::__mt_alloc< _Tp >::_Block_record::_M_next, __gnu_cxx::__mt_alloc< _Tp >::_S_bin_size, __gnu_cxx::__mt_alloc< _Tp >::_S_binmap, __gnu_cxx::__mt_alloc< _Tp >::_S_get_thread_id(), and __gnu_cxx::__mt_alloc< _Tp >::_S_options.

template<typename _Tp>
void __gnu_cxx::__mt_alloc< _Tp >::destroy pointer  __p  )  [inline]
 

Definition at line 109 of file mt_allocator.h.

template<typename _Tp>
size_type __gnu_cxx::__mt_alloc< _Tp >::max_size void   )  const throw () [inline]
 

Definition at line 99 of file mt_allocator.h.


Member Data Documentation

template<typename _Tp>
__mt_alloc< _Tp >::_Bin_record *volatile __gnu_cxx::__mt_alloc< _Tp >::_S_bin [static, private]
 

Definition at line 691 of file mt_allocator.h.

template<typename _Tp>
size_t __gnu_cxx::__mt_alloc< _Tp >::_S_bin_size = 1 [static, private]
 

Definition at line 694 of file mt_allocator.h.

Referenced by __gnu_cxx::__mt_alloc< _Tp >::_S_initialize(), and __gnu_cxx::__mt_alloc< _Tp >::deallocate().

template<typename _Tp>
__mt_alloc< _Tp >::_Binmap_type * __gnu_cxx::__mt_alloc< _Tp >::_S_binmap [static, private]
 

Definition at line 688 of file mt_allocator.h.

Referenced by __gnu_cxx::__mt_alloc< _Tp >::_S_initialize(), __gnu_cxx::__mt_alloc< _Tp >::allocate(), and __gnu_cxx::__mt_alloc< _Tp >::deallocate().

template<typename _Tp>
bool __gnu_cxx::__mt_alloc< _Tp >::_S_init = false [static, private]
 

Definition at line 682 of file mt_allocator.h.

Referenced by __gnu_cxx::__mt_alloc< _Tp >::_S_initialize(), __gnu_cxx::__mt_alloc< _Tp >::_S_set_options(), and __gnu_cxx::__mt_alloc< _Tp >::allocate().

template<typename _Tp>
__mt_alloc< _Tp >::_Tune __gnu_cxx::__mt_alloc< _Tp >::_S_options [static, private]
 

Definition at line 685 of file mt_allocator.h.

Referenced by __gnu_cxx::__mt_alloc< _Tp >::_S_get_options(), __gnu_cxx::__mt_alloc< _Tp >::_S_initialize(), __gnu_cxx::__mt_alloc< _Tp >::_S_set_options(), __gnu_cxx::__mt_alloc< _Tp >::allocate(), and __gnu_cxx::__mt_alloc< _Tp >::deallocate().


The documentation for this class was generated from the following file:
Generated on Tue Jan 30 17:32:02 2007 for GNU C++ STL by doxygen 1.3.6