STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Private Member Functions | List of all members
stdext::allocators::sync_per_thread< _Cache > Class Template Reference

Public Member Functions

voidallocate (size_t _Count)
 
void deallocate (void *_Ptr, size_t _Count)
 
bool equals (const sync_per_thread< _Cache > &_Other) const
 

Static Private Member Functions

static __declspec (thread) _Cache *_Mycache_ptr
 

Member Function Documentation

template<class _Cache >
static stdext::allocators::sync_per_thread< _Cache >::__declspec ( thread  )
staticprivate
template<class _Cache >
void* stdext::allocators::sync_per_thread< _Cache >::allocate ( size_t  _Count)
inline
156  { // allocate from cache
157  if (_Mycache_ptr == 0)
158  _Mycache_ptr = new _Cache();
159  return (_Mycache_ptr != 0 ? _Mycache_ptr->allocate(_Count) : 0);
160  }
_Diff _Count
Definition: algorithm:1941
template<class _Cache >
void stdext::allocators::sync_per_thread< _Cache >::deallocate ( void _Ptr,
size_t  _Count 
)
inline
163  { // deallocate through cache
164  if (_Mycache_ptr != 0)
165  _Mycache_ptr->deallocate(_Ptr, _Count);
166  }
_Diff _Count
Definition: algorithm:1941
template<class _Cache >
bool stdext::allocators::sync_per_thread< _Cache >::equals ( const sync_per_thread< _Cache > &  _Other) const
inline
169  { // compare two caches for equality
170  return (_Mycache_ptr != 0
171  && _Other._Mycache_ptr != 0
172  && _Mycache_ptr->equals(*_Other._Mycache_ptr));
173  }

The documentation for this class was generated from the following file: