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) 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 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;
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);
base_allocator_type::pointer pointer
bool operator==(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
tbb_allocator(const tbb_allocator &)
const value_type & const_reference
zero_allocator< U, Allocator > other
malloc_type
Specifies current allocator.
base_allocator_type::size_type size_type
Allocator< void > base_allocator_type
base_allocator_type::value_type value_type
tbb_allocator(const tbb_allocator< U > &)
ptrdiff_t difference_type
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
static malloc_type allocator_type()
Returns current allocator.
base_allocator_type::const_reference const_reference
size_type max_size() const
Largest value for which method allocate might succeed.
zero_allocator< U, Allocator > other
const value_type * const_pointer
zero_allocator(const zero_allocator< U > &a)
internal::allocator_type< T >::value_type value_type
base_allocator_type::const_pointer const_pointer
void const char const char int ITT_FORMAT __itt_group_sync p
base_allocator_type::reference reference
T max(const T &val1, const T &val2)
Utility template function returning greater of the two values.
void *__TBB_EXPORTED_FUNC allocate_via_handler_v3(size_t n)
Allocates memory using MallocHandler.
void destroy(pointer p)
Destroy value at location pointed to by p.
base_allocator_type::difference_type difference_type
pointer allocate(size_type n, const void *=0)
Allocate space for n objects.
const_pointer address(const_reference x) const
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
base_allocator_type::value_type value_type
void deallocate(pointer p, size_type)
Free previously allocated block of memory.
zero_allocator(const zero_allocator &a)
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)
bool operator!=(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
bool __TBB_EXPORTED_FUNC is_malloc_used_v3()
Returns true if standard malloc/free are used to work with memory.
base_allocator_type::pointer pointer
Allocator< T > base_allocator_type
pointer address(reference x) const
pointer allocate(const size_type n, const void *hint=0)
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
const void * const_pointer
base_allocator_type::const_pointer const_pointer
void construct(U *p, Args &&... args)
Copy-construct value at location pointed to by p.