21 #ifndef __TBB_tbb_stddef_H 22 #define __TBB_tbb_stddef_H 25 #define TBB_VERSION_MAJOR 2019 26 #define TBB_VERSION_MINOR 0 29 #define TBB_INTERFACE_VERSION 11005 30 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000 34 #define TBB_COMPATIBLE_INTERFACE_VERSION 2 36 #define __TBB_STRING_AUX(x) #x 37 #define __TBB_STRING(x) __TBB_STRING_AUX(x) 40 #if !defined RC_INVOKED 98 #define __TBB_EXPORTED_FUNC __cdecl 99 #define __TBB_EXPORTED_METHOD __thiscall 101 #define __TBB_EXPORTED_FUNC 102 #define __TBB_EXPORTED_METHOD 105 #if __INTEL_COMPILER || _MSC_VER 106 #define __TBB_NOINLINE(decl) __declspec(noinline) decl 108 #define __TBB_NOINLINE(decl) decl __attribute__ ((noinline)) 110 #define __TBB_NOINLINE(decl) decl 113 #if __TBB_NOEXCEPT_PRESENT 114 #define __TBB_NOEXCEPT(expression) noexcept(expression) 116 #define __TBB_NOEXCEPT(expression) 122 #define __TBB_tbb_windef_H 124 #undef __TBB_tbb_windef_H 126 #if !defined(_MSC_VER) || _MSC_VER>=1600 133 #if __TBBMALLOC_BUILD 134 namespace rml {
namespace internal {
135 #define __TBB_ASSERT_RELEASE(predicate,message) ((predicate)?((void)0) : rml::internal::assertion_failure(__FILE__,__LINE__,#predicate,message)) 138 #define __TBB_ASSERT_RELEASE(predicate,message) ((predicate)?((void)0) : tbb::assertion_failure(__FILE__,__LINE__,#predicate,message)) 150 #if __TBBMALLOC_BUILD 162 #define __TBB_ASSERT(predicate,message) __TBB_ASSERT_RELEASE(predicate,message) 164 #define __TBB_ASSERT_EX __TBB_ASSERT 169 #define __TBB_ASSERT(predicate,comment) ((void)0) 170 #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate))) 179 #if _MSC_VER && _MSC_VER<1600 180 typedef __int8 int8_t;
181 typedef __int16 int16_t;
182 typedef __int32 int32_t;
183 typedef __int64 int64_t;
184 typedef unsigned __int8 uint8_t;
185 typedef unsigned __int16 uint16_t;
186 typedef unsigned __int32 uint32_t;
187 typedef unsigned __int64 uint64_t;
201 using std::ptrdiff_t;
241 #define __TBB_atomic // intentionally empty, see above 243 #if __TBB_OVERRIDE_PRESENT 244 #define __TBB_override override 246 #define __TBB_override // formal comment only 249 #if __TBB_CPP17_FALLTHROUGH_PRESENT 250 #define __TBB_fallthrough [[fallthrough]] 251 #elif __TBB_FALLTHROUGH_PRESENT 252 #define __TBB_fallthrough __attribute__ ((fallthrough)) 254 #define __TBB_fallthrough 257 template<
class T,
size_t S,
size_t R>
264 template<
class T,
size_t S = NFS_MaxLineSize>
270 #define __TBB_offsetof(class_name, member_name) \ 271 ((ptrdiff_t)&(reinterpret_cast<class_name*>(0x1000)->member_name) - 0x1000) 274 #define __TBB_get_object_ref(class_name, member_name, member_addr) \ 275 (*reinterpret_cast<class_name*>((char*)member_addr - __TBB_offsetof(class_name, member_name))) 280 #if TBB_USE_EXCEPTIONS 281 #define __TBB_TRY try 282 #define __TBB_CATCH(e) catch(e) 283 #define __TBB_THROW(e) throw e 284 #define __TBB_RETHROW() throw 288 #define __TBB_CATCH(e) if ( tbb::internal::__TBB_false() ) 289 #define __TBB_THROW(e) tbb::internal::suppress_unused_warning(e) 290 #define __TBB_RETHROW() ((void)0) 297 static void*
const poisoned_ptr = reinterpret_cast<void*>(-1);
306 inline bool is_poisoned( T*
p ) {
return p == reinterpret_cast<T*>(poisoned_ptr); }
317 template<
typename T,
typename U>
319 uintptr_t x = reinterpret_cast<uintptr_t>(ptr);
320 return reinterpret_cast<T>(x);
343 #if TBB_DEPRECATED_MUTEX_COPYING 354 return 0==((uintptr_t)pointer & (alignment-1));
358 template<
typename integer_type>
360 return arg && (0 == (arg & (arg - 1)));
364 template<
typename argument_
integer_type,
typename divisor_
integer_type>
365 inline argument_integer_type
modulo_power_of_two(argument_integer_type arg, divisor_integer_type divisor) {
367 return (arg & (divisor - 1));
374 template<
typename argument_
integer_type,
typename power2_
integer_type>
377 return 0 == (arg & (arg - power2));
419 #if __TBB_ENABLE_RANGE_FEEDBACK 420 void set_proportion(
size_t _left,
size_t _right) {
434 #if __TBB_CPP11_SMART_POINTERS_PRESENT 438 #if __TBB_CPP11_RVALUE_REF_PRESENT || __TBB_CPP11_DECLTYPE_PRESENT || _LIBCPP_VERSION 445 #if __TBB_CPP11_SMART_POINTERS_PRESENT && __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 446 template<
typename T,
typename... Args>
447 std::unique_ptr<T> make_unique(Args&&... args) {
448 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
476 template <
unsigned u,
unsigned long long ull >
480 static const size_t value = (size_t)((
sizeof(
size_t)==
sizeof(u)) ? u : ull);
483 #if __TBB_CPP11_RVALUE_REF_PRESENT 486 #elif defined(_LIBCPP_NAMESPACE) 489 using std::_LIBCPP_NAMESPACE::forward;
492 template <
typename T>
493 T&
move( T& x ) {
return x; }
494 template <
typename T>
495 T& forward( T& x ) {
return x; }
499 #if __TBB_CPP11_RVALUE_REF_PRESENT 500 #define __TBB_FORWARDING_REF(A) A&& 504 #define __TBB_FORWARDING_REF(A) A& 506 #if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 507 #define __TBB_PARAMETER_PACK ... 508 #define __TBB_PACK_EXPANSION(A) A... 510 #define __TBB_PARAMETER_PACK 511 #define __TBB_PACK_EXPANSION(A) A 514 #if __TBB_CPP11_DECLTYPE_PRESENT 515 #if __TBB_CPP11_DECLVAL_BROKEN 523 template <
bool condition>
535 #if __TBB_STATIC_ASSERT_PRESENT 536 #define __TBB_STATIC_ASSERT(condition,msg) static_assert(condition,msg) 539 #define __TBB_STATIC_ASSERT_IMPL1(condition,msg,line) \ 540 enum {static_assert_on_line_##line = tbb::internal::STATIC_ASSERTION_FAILED<!(condition)>::value} 542 #define __TBB_STATIC_ASSERT_IMPL(condition,msg,line) __TBB_STATIC_ASSERT_IMPL1(condition,msg,line) 543 #define __TBB_STATIC_ASSERT(condition,msg) __TBB_STATIC_ASSERT_IMPL(condition,msg,__LINE__) void __TBB_EXPORTED_FUNC runtime_warning(const char *format,...)
Report a runtime warning.
A template to select either 32-bit or 64-bit constant as compile time, depending on machine word size...
Type enables transmission of splitting proportion from partitioners to range objects.
int __TBB_EXPORTED_FUNC TBB_runtime_interface_version()
The function returns the interface version of the TBB shared library being used.
T punned_cast(U *ptr)
Cast between unrelated pointer types.
argument_integer_type modulo_power_of_two(argument_integer_type arg, divisor_integer_type divisor)
A function to compute arg modulo divisor where divisor is a power of 2.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
bool_constant< true > true_type
no_copy()
Allow default construction.
Base class for types that should not be copied or assigned.
bool is_power_of_two(integer_type arg)
A function to check if passed integer is a power of 2.
version_tag_v3 version_tag
static const size_t value
void const char const char int ITT_FORMAT __itt_group_sync p
bool is_power_of_two_at_least(argument_integer_type arg, power2_integer_type power2)
A function to determine if arg is a power of 2 at least as big as another power of 2.
Base class for types that should not be assigned.
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 ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark S
void __TBB_EXPORTED_FUNC assertion_failure(const char *filename, int line, const char *expression, const char *comment)
Process an assertion failure.
#define __TBB_FORWARDING_REF(A)
bool is_aligned(T *pointer, uintptr_t alignment)
A function to check if passed in pointer is aligned on a specific border.
Dummy type that distinguishes splitting constructor from copy constructor.
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
proportional_split(size_t _left=1, size_t _right=1)
#define __TBB_EXPORTED_FUNC
void poison_pointer(T *__TBB_atomic &)
void move(tbb_thread &t1, tbb_thread &t2)
void operator=(const no_assign &)
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
bool_constant< false > false_type
assertion_handler_type __TBB_EXPORTED_FUNC set_assertion_handler(assertion_handler_type new_handler)
Set assertion handler and return previous value of it.
void __TBB_EXPORTED_FUNC handle_perror(int error_code, const char *aux_info)
Throws std::runtime_error with what() returning error_code description prefixed with aux_info.
Class for determining type of std::allocator<T>::value_type.
void(* assertion_handler_type)(const char *filename, int line, const char *expression, const char *comment)
Type for an assertion handler.
Pads type T to fill out to a multiple of cache line size.