Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Go to the documentation of this file.
17 #ifndef __TBB_tbb_allocator_H
18 #define __TBB_tbb_allocator_H
22 #if __TBB_ALLOCATOR_CONSTRUCT_VARIADIC
45 #if _MSC_VER && !defined(__INTEL_COMPILER)
47 #pragma warning (push)
48 #pragma warning (disable: 4100)
97 return (
max > 0 ?
max : 1);
101 #if __TBB_ALLOCATOR_CONSTRUCT_VARIADIC
102 template<
typename U,
typename... Args>
104 { ::new((
void *)
p) U(std::forward<Args>(args)...); }
105 #else // __TBB_ALLOCATOR_CONSTRUCT_VARIADIC
106 #if __TBB_CPP11_RVALUE_REF_PRESENT
110 #endif // __TBB_ALLOCATOR_CONSTRUCT_VARIADIC
121 #if _MSC_VER && !defined(__INTEL_COMPILER)
122 #pragma warning (pop)
123 #endif // warning 4100 is back
133 template<
typename U>
struct rebind {
138 template<
typename T,
typename U>
141 template<
typename T,
typename U>
150 template <
typename T,
template<
typename X>
class Allocator = tbb_allocator>
156 typedef typename base_allocator_type::pointer
pointer;
158 typedef typename base_allocator_type::reference
reference;
160 typedef typename base_allocator_type::size_type
size_type;
172 pointer ptr = base_allocator_type::allocate( n, hint );
173 std::memset( static_cast<void*>(ptr), 0, n *
sizeof(
value_type) );
180 template<
template<
typename T>
class Allocator>
185 typedef typename base_allocator_type::pointer
pointer;
187 template<
typename U>
struct rebind {
192 template<
typename T1,
template<
typename X1>
class B1,
typename T2,
template<
typename X2>
class B2>
194 return static_cast< B1<T1>
>(a) ==
static_cast< B2<T2>
>(b);
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);
pointer address(reference x) const
void __TBB_EXPORTED_FUNC deallocate_via_handler_v3(void *p)
Deallocates memory using FreeHandler.
tbb_allocator(const tbb_allocator &)
base_allocator_type::const_pointer const_pointer
const typedef void * const_pointer
void destroy(pointer p)
Destroy value at location pointed to by p.
base_allocator_type::const_reference const_reference
const typedef value_type * const_pointer
pointer allocate(size_type n, const void *=0)
Allocate space for n objects.
pointer allocate(const size_type n, const void *hint=0)
bool operator!=(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
size_type max_size() const
Largest value for which method allocate might succeed.
Allocator< T > base_allocator_type
zero_allocator< U, Allocator > other
base_allocator_type::pointer pointer
zero_allocator(const zero_allocator &a)
tbb_allocator(const tbb_allocator< U > &)
Allocator< void > base_allocator_type
bool operator==(const cache_aligned_allocator< T > &, const cache_aligned_allocator< U > &)
void move(tbb_thread &t1, tbb_thread &t2)
const typedef value_type & const_reference
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
void construct(U *p, Args &&... args)
Copy-construct value at location pointed to by p.
zero_allocator(const zero_allocator< U > &a)
internal::allocator_type< T >::value_type value_type
const_pointer address(const_reference x) const
void *__TBB_EXPORTED_FUNC allocate_via_handler_v3(size_t n)
Allocates memory using MallocHandler.
base_allocator_type::const_pointer const_pointer
#define __TBB_EXPORTED_FUNC
base_allocator_type::value_type value_type
T max(const T &val1, const T &val2)
Utility template function returning greater of the two values.
void deallocate(pointer p, size_type)
Free previously allocated block of memory.
ptrdiff_t difference_type
base_allocator_type::difference_type difference_type
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
zero_allocator< U, Allocator > other
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
base_allocator_type::value_type value_type
base_allocator_type::reference reference
malloc_type
Specifies current allocator.
void const char const char int ITT_FORMAT __itt_group_sync p
static malloc_type allocator_type()
Returns current allocator.
base_allocator_type::pointer pointer
base_allocator_type::size_type size_type
bool __TBB_EXPORTED_FUNC is_malloc_used_v3()
Returns true if standard malloc/free are used to work with memory.
Copyright © 2005-2020 Intel Corporation. All Rights Reserved.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.