17 #ifndef __TBB_tbb_stddef_H    18 #define __TBB_tbb_stddef_H    21 #define TBB_VERSION_MAJOR 2020    22 #define TBB_VERSION_MINOR 3    25 #define TBB_INTERFACE_VERSION 11103    26 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000    30 #define TBB_COMPATIBLE_INTERFACE_VERSION 2    32 #define __TBB_STRING_AUX(x) #x    33 #define __TBB_STRING(x) __TBB_STRING_AUX(x)    36 #if !defined RC_INVOKED    94     #define __TBB_EXPORTED_FUNC   __cdecl    95     #define __TBB_EXPORTED_METHOD __thiscall    97     #define __TBB_EXPORTED_FUNC    98     #define __TBB_EXPORTED_METHOD   101 #if __INTEL_COMPILER || _MSC_VER   102 #define __TBB_NOINLINE(decl) __declspec(noinline) decl   104 #define __TBB_NOINLINE(decl) decl __attribute__ ((noinline))   106 #define __TBB_NOINLINE(decl) decl   109 #if __TBB_NOEXCEPT_PRESENT   110 #define __TBB_NOEXCEPT(expression) noexcept(expression)   112 #define __TBB_NOEXCEPT(expression)   118     #define __TBB_tbb_windef_H   120     #undef __TBB_tbb_windef_H   122 #if !defined(_MSC_VER) || _MSC_VER>=1600   129 #if __TBBMALLOC_BUILD   130 namespace rml { 
namespace internal {
   131  #define __TBB_ASSERT_RELEASE(predicate,message) ((predicate)?((void)0) : rml::internal::assertion_failure(__FILE__,__LINE__,#predicate,message))   134  #define __TBB_ASSERT_RELEASE(predicate,message) ((predicate)?((void)0) : tbb::assertion_failure(__FILE__,__LINE__,#predicate,message))   146 #if __TBBMALLOC_BUILD   158     #define __TBB_ASSERT(predicate,message) __TBB_ASSERT_RELEASE(predicate,message)   160     #define __TBB_ASSERT_EX __TBB_ASSERT   165     #define __TBB_ASSERT(predicate,comment) ((void)0)   166     #define __TBB_ASSERT_EX(predicate,comment) ((void)(1 && (predicate)))   175 #if _MSC_VER && _MSC_VER<1600   176         typedef __int8 int8_t;
   177         typedef __int16 int16_t;
   178         typedef __int32 int32_t;
   179         typedef __int64 int64_t;
   180         typedef unsigned __int8 uint8_t;
   181         typedef unsigned __int16 uint16_t;
   182         typedef unsigned __int32 uint32_t;
   183         typedef unsigned __int64 uint64_t;
   197     using std::ptrdiff_t;
   237 #define __TBB_atomic // intentionally empty, see above   239 #if __TBB_OVERRIDE_PRESENT   240 #define __TBB_override override   242 #define __TBB_override // formal comment only   245 #if __TBB_CPP17_FALLTHROUGH_PRESENT   246 #define __TBB_fallthrough [[fallthrough]]   247 #elif __TBB_FALLTHROUGH_PRESENT   248 #define __TBB_fallthrough __attribute__ ((fallthrough))   250 #define __TBB_fallthrough   253 template<
class T, 
size_t S, 
size_t R>
   260 template<
class T, 
size_t S = NFS_MaxLineSize>
   266 #define __TBB_offsetof(class_name, member_name) \   267     ((ptrdiff_t)&(reinterpret_cast<class_name*>(0x1000)->member_name) - 0x1000)   270 #define __TBB_get_object_ref(class_name, member_name, member_addr) \   271     (*reinterpret_cast<class_name*>((char*)member_addr - __TBB_offsetof(class_name, member_name)))   276 #if TBB_USE_EXCEPTIONS   277     #define __TBB_TRY try   278     #define __TBB_CATCH(e) catch(e)   279     #define __TBB_THROW(e) throw e   280     #define __TBB_RETHROW() throw   284     #define __TBB_CATCH(e) if ( tbb::internal::__TBB_false() )   285     #define __TBB_THROW(e) tbb::internal::suppress_unused_warning(e)   286     #define __TBB_RETHROW() ((void)0)   293 static void* 
const poisoned_ptr = reinterpret_cast<void*>(-1);
   302 inline bool is_poisoned( T* 
p ) { 
return p == reinterpret_cast<T*>(poisoned_ptr); }
   313 template<
typename T, 
typename U>
   315     uintptr_t x = reinterpret_cast<uintptr_t>(ptr);
   316     return reinterpret_cast<T>(x);
   319 #if __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT   350 class no_copy: no_assign {
   360 #if TBB_DEPRECATED_MUTEX_COPYING   361 class mutex_copy_deprecated_and_disabled {};
   371     return 0==((uintptr_t)pointer & (alignment-1));
   375 template<
typename integer_type>
   377     return arg && (0 == (arg & (arg - 1)));
   381 template<
typename argument_
integer_type, 
typename divisor_
integer_type>
   382 inline argument_integer_type 
modulo_power_of_two(argument_integer_type arg, divisor_integer_type divisor) {
   384     return (arg & (divisor - 1));
   391 template<
typename argument_
integer_type, 
typename power2_
integer_type>
   394     return 0 == (arg & (arg - power2));
   436 #if __TBB_ENABLE_RANGE_FEEDBACK   437     void set_proportion(
size_t _left, 
size_t _right) {
   451 #if __TBB_CPP11_SMART_POINTERS_PRESENT   455 #if __TBB_CPP11_RVALUE_REF_PRESENT || __TBB_CPP11_DECLTYPE_PRESENT || _LIBCPP_VERSION   462 #if __TBB_CPP11_SMART_POINTERS_PRESENT && __TBB_CPP11_RVALUE_REF_PRESENT && __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT   463     template<
typename T, 
typename... Args>
   464     std::unique_ptr<T> make_unique(Args&&... args) {
   465         return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
   493 template <
unsigned u, 
unsigned long long ull >
   497     static const size_t value = (size_t)((
sizeof(
size_t)==
sizeof(u)) ? u : ull);
   500 #if __TBB_CPP11_RVALUE_REF_PRESENT   503 #elif defined(_LIBCPP_NAMESPACE)   506 using std::_LIBCPP_NAMESPACE::forward;
   509 template <
typename T>
   510 T& 
move( T& x ) { 
return x; }
   511 template <
typename T>
   512 T& forward( T& x ) { 
return x; }
   516 #if __TBB_CPP11_RVALUE_REF_PRESENT   517 #define  __TBB_FORWARDING_REF(A) A&&   521 #define  __TBB_FORWARDING_REF(A) A&   523 #if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT   524 #define __TBB_PARAMETER_PACK ...   525 #define __TBB_PACK_EXPANSION(A) A...   527 #define __TBB_PARAMETER_PACK   528 #define __TBB_PACK_EXPANSION(A) A   531 #if __TBB_CPP11_DECLTYPE_PRESENT   532 #if __TBB_CPP11_DECLVAL_BROKEN   540 template <
bool condition>
   552 #if __TBB_STATIC_ASSERT_PRESENT   553 #define __TBB_STATIC_ASSERT(condition,msg) static_assert(condition,msg)   556 #define __TBB_STATIC_ASSERT_IMPL1(condition,msg,line)       \   557     enum {static_assert_on_line_##line = tbb::internal::STATIC_ASSERTION_FAILED<!(condition)>::value}   559 #define __TBB_STATIC_ASSERT_IMPL(condition,msg,line) __TBB_STATIC_ASSERT_IMPL1(condition,msg,line)   560 #define __TBB_STATIC_ASSERT(condition,msg) __TBB_STATIC_ASSERT_IMPL(condition,msg,__LINE__) bool_constant< true > true_type
 
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.
 
int __TBB_EXPORTED_FUNC TBB_runtime_interface_version()
The function returns the interface version of the TBB shared library being used.
 
assertion_handler_type __TBB_EXPORTED_FUNC set_assertion_handler(assertion_handler_type new_handler)
Set assertion handler and return previous value of it.
 
#define __TBB_EXPORTED_FUNC
 
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_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
 
static const size_t value
 
void(* assertion_handler_type)(const char *filename, int line, const char *expression, const char *comment)
Type for an assertion handler.
 
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.
 
T punned_cast(U *ptr)
Cast between unrelated pointer types.
 
Base class for types that should not be assigned.
 
A template to select either 32-bit or 64-bit constant as compile time, depending on machine word size...
 
bool_constant< false > false_type
 
bool is_aligned(T *pointer, uintptr_t alignment)
A function to check if passed in pointer is aligned on a specific border.
 
void operator=(const no_assign &)=delete
 
Type enables transmission of splitting proportion from partitioners to range objects.
 
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
 
version_tag_v3 version_tag
 
Pads type T to fill out to a multiple of cache line size.
 
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.
 
Dummy type that distinguishes splitting constructor from copy constructor.
 
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
 
Base class for types that should not be copied or assigned.
 
Class for determining type of std::allocator<T>::value_type.
 
proportional_split(size_t _left=1, size_t _right=1)
 
#define __TBB_FORWARDING_REF(A)
 
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
 
bool is_power_of_two(integer_type arg)
A function to check if passed integer is a power of 2.
 
void poison_pointer(T *__TBB_atomic &)
 
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 __TBB_EXPORTED_FUNC runtime_warning(const char *format,...)
Report a runtime warning.
 
void __TBB_EXPORTED_FUNC assertion_failure(const char *filename, int line, const char *expression, const char *comment)
Process an assertion failure.
 
void move(tbb_thread &t1, tbb_thread &t2)