21 #ifndef __TBB_tbb_allocator_H 22 #define __TBB_tbb_allocator_H 26 #if __TBB_ALLOCATOR_CONSTRUCT_VARIADIC 49 #if _MSC_VER && !defined(__INTEL_COMPILER) 51 #pragma warning (push) 52 #pragma warning (disable: 4100) 85 pointer
address(reference x)
const {
return &x;}
86 const_pointer
address(const_reference x)
const {
return &x;}
89 pointer
allocate( size_type n,
const void* = 0) {
100 size_type
max =
static_cast<size_type
>(-1) /
sizeof (value_type);
101 return (max > 0 ? max : 1);
105 #if __TBB_ALLOCATOR_CONSTRUCT_VARIADIC 106 template<
typename U,
typename... Args>
108 { ::new((
void *)p) U(std::forward<Args>(args)...); }
109 #else // __TBB_ALLOCATOR_CONSTRUCT_VARIADIC 110 #if __TBB_CPP11_RVALUE_REF_PRESENT 111 void construct( pointer
p, value_type&&
value ) {::new((
void*)(p)) value_type(
std::move(
value));}
113 void construct( pointer p,
const value_type&
value ) {::new((
void*)(p)) value_type(value);}
114 #endif // __TBB_ALLOCATOR_CONSTRUCT_VARIADIC 125 #if _MSC_VER && !defined(__INTEL_COMPILER) 126 #pragma warning (pop) 127 #endif // warning 4100 is back 137 template<
typename U>
struct rebind {
142 template<
typename T,
typename U>
145 template<
typename T,
typename U>
154 template <
typename T,
template<
typename X>
class Allocator =
tbb_allocator>
160 typedef typename base_allocator_type::pointer
pointer;
162 typedef typename base_allocator_type::reference
reference;
164 typedef typename base_allocator_type::size_type
size_type;
175 pointer
allocate(
const size_type n,
const void *hint = 0 ) {
176 pointer ptr = base_allocator_type::allocate( n, hint );
177 std::memset( static_cast<void*>(ptr), 0, n *
sizeof(value_type) );
184 template<
template<
typename T>
class Allocator>
189 typedef typename base_allocator_type::pointer
pointer;
191 template<
typename U>
struct rebind {
196 template<
typename T1,
template<
typename X1>
class B1,
typename T2,
template<
typename X2>
class B2>
198 return static_cast< B1<T1>
>(a) ==
static_cast< B2<T2>
>(b);
200 template<
typename T1,
template<
typename X1>
class B1,
typename T2,
template<
typename X2>
class B2>
202 return static_cast< B1<T1>
>(a) !=
static_cast< B2<T2>
>(b);
Allocator< T > base_allocator_type
base_allocator_type::pointer pointer
bool operator==(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
pointer address(reference x) const
base_allocator_type::value_type value_type
const value_type * const_pointer
base_allocator_type::const_reference const_reference
tbb_allocator(const tbb_allocator< U > &)
base_allocator_type::const_pointer const_pointer
const_pointer address(const_reference x) const
bool operator!=(const vector_iterator< Container, T > &i, const vector_iterator< Container, U > &j)
zero_allocator(const zero_allocator< U > &a)
void const char const char int ITT_FORMAT __itt_group_sync p
base_allocator_type::size_type size_type
base_allocator_type::reference reference
malloc_type
Specifies current allocator.
size_type max_size() const
Largest value for which method allocate might succeed.
T max(const T &val1, const T &val2)
Utility template function returning greater of the two values.
static malloc_type allocator_type()
Returns current allocator.
void *__TBB_EXPORTED_FUNC allocate_via_handler_v3(size_t n)
Allocates memory using MallocHandler.
void construct(U *p, Args &&... args)
Copy-construct value at location pointed to by p.
base_allocator_type::pointer pointer
tbb_allocator(const tbb_allocator &)
zero_allocator(const zero_allocator &a)
zero_allocator< U, Allocator > other
base_allocator_type::const_pointer const_pointer
internal::allocator_type< T >::value_type value_type
const void * const_pointer
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
void destroy(pointer p)
Destroy value at location pointed to by p.
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
void __TBB_EXPORTED_FUNC deallocate_via_handler_v3(void *p)
Deallocates memory using FreeHandler.
#define __TBB_EXPORTED_FUNC
void move(tbb_thread &t1, tbb_thread &t2)
Allocator< void > base_allocator_type
pointer allocate(size_type n, const void *=0)
Allocate space for n objects.
bool __TBB_EXPORTED_FUNC is_malloc_used_v3()
Returns true if standard malloc/free are used to work with memory.
zero_allocator< U, Allocator > other
pointer allocate(const size_type n, const void *hint=0)
const value_type & const_reference
void deallocate(pointer p, size_type)
Free previously allocated block of memory.
ptrdiff_t difference_type
base_allocator_type::value_type value_type
base_allocator_type::difference_type difference_type
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.