_concurrent_unordered_impl.h   _concurrent_unordered_impl.h 
skipping to change at line 43 skipping to change at line 43
// Suppress "C++ exception handler used, but unwind semantics are not e nabled" warning in STL headers // Suppress "C++ exception handler used, but unwind semantics are not e nabled" warning in STL headers
#pragma warning (push) #pragma warning (push)
#pragma warning (disable: 4530) #pragma warning (disable: 4530)
#endif #endif
#include <iterator> #include <iterator>
#include <utility> // Need std::pair #include <utility> // Need std::pair
#include <functional> // Need std::equal_to (in ../concurrent_unordered_* .h) #include <functional> // Need std::equal_to (in ../concurrent_unordered_* .h)
#include <string> // For tbb_hasher #include <string> // For tbb_hasher
#include <cstring> // Need std::memset #include <cstring> // Need std::memset
#include <algorithm> // Need std::swap
#if !TBB_USE_EXCEPTIONS && _MSC_VER #if !TBB_USE_EXCEPTIONS && _MSC_VER
#pragma warning (pop) #pragma warning (pop)
#endif #endif
#include "../atomic.h" #include "../atomic.h"
#include "../tbb_exception.h" #include "../tbb_exception.h"
#include "../tbb_allocator.h" #include "../tbb_allocator.h"
#if __TBB_INITIALIZER_LISTS_PRESENT #if __TBB_INITIALIZER_LISTS_PRESENT
skipping to change at line 497 skipping to change at line 498
// Insert a new element between passed in iterators // Insert a new element between passed in iterators
std::pair<iterator, bool> try_insert(raw_iterator it, raw_iterator next , const value_type &value, sokey_t order_key, size_type *new_count) std::pair<iterator, bool> try_insert(raw_iterator it, raw_iterator next , const value_type &value, sokey_t order_key, size_type *new_count)
{ {
nodeptr_t pnode = create_node(order_key, value); nodeptr_t pnode = create_node(order_key, value);
nodeptr_t inserted_node = try_insert(it.get_node_ptr(), pnode, next .get_node_ptr()); nodeptr_t inserted_node = try_insert(it.get_node_ptr(), pnode, next .get_node_ptr());
if (inserted_node == pnode) if (inserted_node == pnode)
{ {
// If the insert succeeded, check that the order is correct and increment the element count // If the insert succeeded, check that the order is correct and increment the element count
check_range(); check_range(it, next);
*new_count = __TBB_FetchAndAddW((uintptr_t*)&my_element_count, uintptr_t(1)); *new_count = __TBB_FetchAndAddW((uintptr_t*)&my_element_count, uintptr_t(1));
return std::pair<iterator, bool>(iterator(pnode, this), true); return std::pair<iterator, bool>(iterator(pnode, this), true);
} }
else else
{ {
// If the insert failed (element already there), then delete th e new one // If the insert failed (element already there), then delete th e new one
destroy_node(pnode); destroy_node(pnode);
return std::pair<iterator, bool>(end(), false); return std::pair<iterator, bool>(end(), false);
} }
} }
skipping to change at line 538 skipping to change at line 539
if (where == last || get_order_key(where) > order_key) if (where == last || get_order_key(where) > order_key)
{ {
__TBB_ASSERT(get_order_key(it) < order_key, "Invalid node o rder in the list"); __TBB_ASSERT(get_order_key(it) < order_key, "Invalid node o rder in the list");
// Try to insert it in the right place // Try to insert it in the right place
nodeptr_t inserted_node = try_insert(it.get_node_ptr(), dum my_node, where.get_node_ptr()); nodeptr_t inserted_node = try_insert(it.get_node_ptr(), dum my_node, where.get_node_ptr());
if (inserted_node == dummy_node) if (inserted_node == dummy_node)
{ {
// Insertion succeeded, check the list for order violat ions // Insertion succeeded, check the list for order violat ions
check_range(); check_range(it, where);
return raw_iterator(dummy_node); return raw_iterator(dummy_node);
} }
else else
{ {
// Insertion failed: either dummy node was inserted by another thread, or // Insertion failed: either dummy node was inserted by another thread, or
// a real element was inserted at exactly the same plac e as dummy node. // a real element was inserted at exactly the same plac e as dummy node.
// Proceed with the search from the previous location w here order key was // Proceed with the search from the previous location w here order key was
// known to be larger (note: this is legal only because there is no safe // known to be larger (note: this is legal only because there is no safe
// concurrent erase operation supported). // concurrent erase operation supported).
where = it; where = it;
skipping to change at line 620 skipping to change at line 621
} }
check_range(); check_range();
} }
private: private:
//Need to setup private fields of split_ordered_list in move constructo r and assignment of concurrent_unordered_base //Need to setup private fields of split_ordered_list in move constructo r and assignment of concurrent_unordered_base
template <typename Traits> template <typename Traits>
friend class concurrent_unordered_base; friend class concurrent_unordered_base;
// Check the list for order violations // Check the list for order violations
void check_range() void check_range( raw_iterator first, raw_iterator last )
{ {
#if TBB_USE_ASSERT #if TBB_USE_ASSERT
for (raw_iterator it = raw_begin(); it != raw_end(); ++it) for (raw_iterator it = first; it != last; ++it)
{ {
raw_iterator next_iterator = it; raw_iterator next = it;
++next_iterator; ++next;
__TBB_ASSERT(next_iterator == end() || next_iterator.get_node_p tr()->get_order_key() >= it.get_node_ptr()->get_order_key(), "!!! List orde r inconsistency !!!"); __TBB_ASSERT(next == raw_end() || get_order_key(next) >= get_or der_key(it), "!!! List order inconsistency !!!");
} }
#else
tbb::internal::suppress_unused_warning(first, last);
#endif
}
void check_range()
{
#if TBB_USE_ASSERT
check_range( raw_begin(), raw_end() );
#endif #endif
} }
typename allocator_type::template rebind<node>::other my_node_allocator ; // allocator object for nodes typename allocator_type::template rebind<node>::other my_node_allocator ; // allocator object for nodes
size_type my_element_count; // Total item count, not counting dummy nodes size_type my_element_count; // Total item count, not counting dummy nodes
nodeptr_t my_head; // pointer to head node nodeptr_t my_head; // pointer to head node
}; };
// Template class for hash compare // Template class for hash compare
template<typename Key, typename Hasher, typename Key_equality> template<typename Key, typename Hasher, typename Key_equality>
 End of changes. 8 change blocks. 
7 lines changed or deleted 16 lines changed or added


 _flow_graph_item_buffer_impl.h   _flow_graph_item_buffer_impl.h 
skipping to change at line 67 skipping to change at line 67
size_type my_tail; size_type my_tail;
bool buffer_empty() { return my_head == my_tail; } bool buffer_empty() { return my_head == my_tail; }
buffer_item_type &item(size_type i) { buffer_item_type &item(size_type i) {
__TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].second ))%alignment_of<buffer_item_state>::value),NULL); __TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].second ))%alignment_of<buffer_item_state>::value),NULL);
__TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].first) )%alignment_of<item_type>::value), NULL); __TBB_ASSERT(!(size_type(&(my_array[i&(my_array_size-1)].first) )%alignment_of<item_type>::value), NULL);
return my_array[i & (my_array_size - 1) ]; return my_array[i & (my_array_size - 1) ];
} }
bool my_item_valid(size_type i) { return item(i).second != no_item; } bool my_item_valid(size_type i) { return (i < my_tail) && (i >= my_ head) && (item(i).second != no_item); }
bool my_item_reserved(size_type i) { return item(i).second == reser ved_item; } bool my_item_reserved(size_type i) { return item(i).second == reser ved_item; }
// object management in buffer // object management in buffer
const item_type &get_my_item(size_t i) { const item_type &get_my_item(size_t i) {
__TBB_ASSERT(my_item_valid(i),"attempt to get invalid item"); __TBB_ASSERT(my_item_valid(i),"attempt to get invalid item");
item_type *itm = (tbb::internal::punned_cast<item_type *>(&(ite m(i).first))); item_type *itm = (tbb::internal::punned_cast<item_type *>(&(ite m(i).first)));
return *(const item_type *)itm; return *(const item_type *)itm;
} }
// may be called with an empty slot or a slot that has already been constructed into. // may be called with an empty slot or a slot that has already been constructed into.
skipping to change at line 212 skipping to change at line 212
} }
copy_front(v); copy_front(v);
destroy_front(); destroy_front();
return true; return true;
} }
// This is used both for reset and for grow_my_array. In the case of grow_my_array // This is used both for reset and for grow_my_array. In the case of grow_my_array
// we want to retain the values of the head and tail. // we want to retain the values of the head and tail.
void clean_up_buffer(bool reset_pointers) { void clean_up_buffer(bool reset_pointers) {
if (my_array) { if (my_array) {
for( size_type i=0; i<my_array_size; ++i ) { for( size_type i=my_head; i<my_tail; ++i ) {
if(my_item_valid(i)) if(my_item_valid(i))
destroy_item(i); destroy_item(i);
} }
allocator_type().deallocate(my_array,my_array_size); allocator_type().deallocate(my_array,my_array_size);
} }
my_array = NULL; my_array = NULL;
if(reset_pointers) { if(reset_pointers) {
my_head = my_tail = my_array_size = 0; my_head = my_tail = my_array_size = 0;
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 _flow_graph_join_impl.h   _flow_graph_join_impl.h 
skipping to change at line 1420 skipping to change at line 1420
typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1; typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1;
public: public:
typedef typename wrap_tuple_elements<2,tag_matching_port,OutputTupl e>::type input_ports_type; typedef typename wrap_tuple_elements<2,tag_matching_port,OutputTupl e>::type input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_type, output_type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename tbb::flow::tuple< f0_p, f1_p > func_initializer_ty pe; typedef typename tbb::flow::tuple< f0_p, f1_p > func_initializer_ty pe;
public: public:
template<typename B0, typename B1> template<typename Body0, typename Body1>
unfolded_join_node(graph &g, B0 b0, B1 b1) : base_type(g, unfolded_join_node(graph &g, Body0 body0, Body1 body1) : base_type(
g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T1, tag_value, Body1>(
body1)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<3,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<3,tag_matching_port,OutputTuple,tag_matching> : public
join_base<3,tag_matching_port,OutputTuple,tag_matching>::type { join_base<3,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1; typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1;
typedef typename tbb::flow::tuple_element<2, OutputTuple>::type T2; typedef typename tbb::flow::tuple_element<2, OutputTuple>::type T2;
public: public:
typedef typename wrap_tuple_elements<3, tag_matching_port, OutputTu ple>::type input_ports_type; typedef typename wrap_tuple_elements<3, tag_matching_port, OutputTu ple>::type input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_type, output_type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p > func_initiali zer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p > func_initiali zer_type;
public: public:
template<typename B0, typename B1, typename B2> template<typename Body0, typename Body1, typename Body2>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2) : base_type(g, unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2)
: base_type(g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T1, tag_value, Body1>(
, body1),
new internal::function_body_leaf<T2, tag_value, B2>(b2) new internal::function_body_leaf<T2, tag_value, Body2>(
body2)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<4,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<4,tag_matching_port,OutputTuple,tag_matching> : public
join_base<4,tag_matching_port,OutputTuple,tag_matching>::type { join_base<4,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1; typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1;
typedef typename tbb::flow::tuple_element<2, OutputTuple>::type T2; typedef typename tbb::flow::tuple_element<2, OutputTuple>::type T2;
skipping to change at line 1473 skipping to change at line 1473
typedef typename wrap_tuple_elements<4, tag_matching_port, OutputTu ple>::type input_ports_type; typedef typename wrap_tuple_elements<4, tag_matching_port, OutputTu ple>::type input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_type, output_type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p > func_in itializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p > func_in itializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3> template<typename Body0, typename Body1, typename Body2, typename B
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3) : base_typ ody3>
e(g, unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
Body3 body3) : base_type(g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T1, tag_value, Body1>(
, body1),
new internal::function_body_leaf<T2, tag_value, B2>(b2) new internal::function_body_leaf<T2, tag_value, Body2>(
, body2),
new internal::function_body_leaf<T3, tag_value, B3>(b3) new internal::function_body_leaf<T3, tag_value, Body3>(
body3)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<5,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<5,tag_matching_port,OutputTuple,tag_matching> : public
join_base<5,tag_matching_port,OutputTuple,tag_matching>::type { join_base<5,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1; typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1;
typedef typename tbb::flow::tuple_element<2, OutputTuple>::type T2; typedef typename tbb::flow::tuple_element<2, OutputTuple>::type T2;
skipping to change at line 1504 skipping to change at line 1504
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_type, output_type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p > f unc_initializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p > f unc_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena template<typename Body0, typename Body1, typename Body2, typename B
me B4> ody3, typename Body4>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4) : b unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
ase_type(g, Body3 body3, Body4 body4) : base_type(g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T1, tag_value, Body1>(
, body1),
new internal::function_body_leaf<T2, tag_value, B2>(b2) new internal::function_body_leaf<T2, tag_value, Body2>(
, body2),
new internal::function_body_leaf<T3, tag_value, B3>(b3) new internal::function_body_leaf<T3, tag_value, Body3>(
, body3),
new internal::function_body_leaf<T4, tag_value, B4>(b4) new internal::function_body_leaf<T4, tag_value, Body4>(
body4)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
#if __TBB_VARIADIC_MAX >= 6 #if __TBB_VARIADIC_MAX >= 6
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<6,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<6,tag_matching_port,OutputTuple,tag_matching> : public
join_base<6,tag_matching_port,OutputTuple,tag_matching>::type { join_base<6,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1; typedef typename tbb::flow::tuple_element<1, OutputTuple>::type T1;
skipping to change at line 1539 skipping to change at line 1539
private: private:
typedef join_node_base<tag_matching, input_ports_type, output_type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p > func_initializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p > func_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena template<typename Body0, typename Body1, typename Body2, typename B
me B4, typename B5> ody3, typename Body4, typename Body5>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
b5) : base_type(g, Body3 body3, Body4 body4, Body5 body5)
func_initializer_type( : base_type(g, func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T1, tag_value, Body1>(
, body1),
new internal::function_body_leaf<T2, tag_value, B2>(b2) new internal::function_body_leaf<T2, tag_value, Body2>(
, body2),
new internal::function_body_leaf<T3, tag_value, B3>(b3) new internal::function_body_leaf<T3, tag_value, Body3>(
, body3),
new internal::function_body_leaf<T4, tag_value, B4>(b4) new internal::function_body_leaf<T4, tag_value, Body4>(
, body4),
new internal::function_body_leaf<T5, tag_value, B5>(b5) new internal::function_body_leaf<T5, tag_value, Body5>(
body5)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
#endif #endif
#if __TBB_VARIADIC_MAX >= 7 #if __TBB_VARIADIC_MAX >= 7
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<7,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<7,tag_matching_port,OutputTuple,tag_matching> : public
join_base<7,tag_matching_port,OutputTuple,tag_matching>::type { join_base<7,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
skipping to change at line 1578 skipping to change at line 1578
typedef join_node_base<tag_matching, input_ports_type, output_type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p > func_initializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p > func_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena template<typename Body0, typename Body1, typename Body2, typename B
me B4, typename B5, typename B6> ody3, typename Body4,
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 typename Body5, typename Body6>
b5, B6 b6) : base_type(g, unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
func_initializer_type( Body3 body3, Body4 body4,
new internal::function_body_leaf<T0, tag_value, B0>(b0) Body5 body5, Body6 body6) : base_type(g, func_initializer_t
, ype(
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T2, tag_value, B2>(b2) new internal::function_body_leaf<T1, tag_value, Body1>(
, body1),
new internal::function_body_leaf<T3, tag_value, B3>(b3) new internal::function_body_leaf<T2, tag_value, Body2>(
, body2),
new internal::function_body_leaf<T4, tag_value, B4>(b4) new internal::function_body_leaf<T3, tag_value, Body3>(
, body3),
new internal::function_body_leaf<T5, tag_value, B5>(b5) new internal::function_body_leaf<T4, tag_value, Body4>(
, body4),
new internal::function_body_leaf<T6, tag_value, B6>(b6) new internal::function_body_leaf<T5, tag_value, Body5>(
body5),
new internal::function_body_leaf<T6, tag_value, Body6>(
body6)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
#endif #endif
#if __TBB_VARIADIC_MAX >= 8 #if __TBB_VARIADIC_MAX >= 8
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<8,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<8,tag_matching_port,OutputTuple,tag_matching> : public
join_base<8,tag_matching_port,OutputTuple,tag_matching>::type { join_base<8,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
skipping to change at line 1620 skipping to change at line 1621
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename internal::function_body<T7, tag_value> *f7_p; typedef typename internal::function_body<T7, tag_value> *f7_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p, f7_p > func_initializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p, f7_p > func_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena template<typename Body0, typename Body1, typename Body2, typename B
me B4, typename B5, typename B6, typename B7> ody3, typename Body4,
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 typename Body5, typename Body6, typename Body7>
b5, B6 b6, B7 b7) : base_type(g, unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
func_initializer_type( Body3 body3, Body4 body4,
new internal::function_body_leaf<T0, tag_value, B0>(b0) Body5 body5, Body6 body6, Body7 body7) : base_type(g, func_
, initializer_type(
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T0, tag_value, Body0>(
, body0),
new internal::function_body_leaf<T2, tag_value, B2>(b2) new internal::function_body_leaf<T1, tag_value, Body1>(
, body1),
new internal::function_body_leaf<T3, tag_value, B3>(b3) new internal::function_body_leaf<T2, tag_value, Body2>(
, body2),
new internal::function_body_leaf<T4, tag_value, B4>(b4) new internal::function_body_leaf<T3, tag_value, Body3>(
, body3),
new internal::function_body_leaf<T5, tag_value, B5>(b5) new internal::function_body_leaf<T4, tag_value, Body4>(
, body4),
new internal::function_body_leaf<T6, tag_value, B6>(b6) new internal::function_body_leaf<T5, tag_value, Body5>(
, body5),
new internal::function_body_leaf<T7, tag_value, B7>(b7) new internal::function_body_leaf<T6, tag_value, Body6>(
body6),
new internal::function_body_leaf<T7, tag_value, Body7>(
body7)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
#endif #endif
#if __TBB_VARIADIC_MAX >= 9 #if __TBB_VARIADIC_MAX >= 9
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<9,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<9,tag_matching_port,OutputTuple,tag_matching> : public
join_base<9,tag_matching_port,OutputTuple,tag_matching>::type { join_base<9,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
skipping to change at line 1665 skipping to change at line 1667
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename internal::function_body<T7, tag_value> *f7_p; typedef typename internal::function_body<T7, tag_value> *f7_p;
typedef typename internal::function_body<T8, tag_value> *f8_p; typedef typename internal::function_body<T8, tag_value> *f8_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p, f7_p, f8_p > func_initializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p, f7_p, f8_p > func_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena template<typename Body0, typename Body1, typename Body2, typename B
me B4, typename B5, typename B6, typename B7, typename B8> ody3, typename Body4,
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 typename Body5, typename Body6, typename Body7, typename B
b5, B6 b6, B7 b7, B8 b8) : base_type(g, ody8>
func_initializer_type( unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
new internal::function_body_leaf<T0, tag_value, B0>(b0) Body3 body3, Body4 body4,
, Body5 body5, Body6 body6, Body7 body7, Body8 body8) : base_
new internal::function_body_leaf<T1, tag_value, B1>(b1) type(g, func_initializer_type(
, new internal::function_body_leaf<T0, tag_value, Body0>(
new internal::function_body_leaf<T2, tag_value, B2>(b2) body0),
, new internal::function_body_leaf<T1, tag_value, Body1>(
new internal::function_body_leaf<T3, tag_value, B3>(b3) body1),
, new internal::function_body_leaf<T2, tag_value, Body2>(
new internal::function_body_leaf<T4, tag_value, B4>(b4) body2),
, new internal::function_body_leaf<T3, tag_value, Body3>(
new internal::function_body_leaf<T5, tag_value, B5>(b5) body3),
, new internal::function_body_leaf<T4, tag_value, Body4>(
new internal::function_body_leaf<T6, tag_value, B6>(b6) body4),
, new internal::function_body_leaf<T5, tag_value, Body5>(
new internal::function_body_leaf<T7, tag_value, B7>(b7) body5),
, new internal::function_body_leaf<T6, tag_value, Body6>(
new internal::function_body_leaf<T8, tag_value, B8>(b8) body6),
new internal::function_body_leaf<T7, tag_value, Body7>(
body7),
new internal::function_body_leaf<T8, tag_value, Body8>(
body8)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
#endif #endif
#if __TBB_VARIADIC_MAX >= 10 #if __TBB_VARIADIC_MAX >= 10
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<10,tag_matching_port,OutputTuple,tag_matching> : public class unfolded_join_node<10,tag_matching_port,OutputTuple,tag_matching> : public
join_base<10,tag_matching_port,OutputTuple,tag_matching>::type { join_base<10,tag_matching_port,OutputTuple,tag_matching>::type {
typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0; typedef typename tbb::flow::tuple_element<0, OutputTuple>::type T0;
skipping to change at line 1713 skipping to change at line 1716
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename internal::function_body<T7, tag_value> *f7_p; typedef typename internal::function_body<T7, tag_value> *f7_p;
typedef typename internal::function_body<T8, tag_value> *f8_p; typedef typename internal::function_body<T8, tag_value> *f8_p;
typedef typename internal::function_body<T9, tag_value> *f9_p; typedef typename internal::function_body<T9, tag_value> *f9_p;
typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p, f7_p, f8_p, f9_p > func_initializer_type; typedef typename tbb::flow::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5 _p, f6_p, f7_p, f8_p, f9_p > func_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena template<typename Body0, typename Body1, typename Body2, typename B
me B4, typename B5, typename B6, typename B7, typename B8, typename B9> ody3, typename Body4,
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 typename Body5, typename Body6, typename Body7, typename Body8,
b5, B6 b6, B7 b7, B8 b8, B9 b9) : base_type(g, typename Body9>
func_initializer_type( unfolded_join_node(graph &g, Body0 body0, Body1 body1, Body2 body2,
new internal::function_body_leaf<T0, tag_value, B0>(b0) Body3 body3, Body4 body4,
, Body5 body5, Body6 body6, Body7 body7, Body8 body8, Body9 b
new internal::function_body_leaf<T1, tag_value, B1>(b1) ody9) : base_type(g, func_initializer_type(
, new internal::function_body_leaf<T0, tag_value, Body0>(
new internal::function_body_leaf<T2, tag_value, B2>(b2) body0),
, new internal::function_body_leaf<T1, tag_value, Body1>(
new internal::function_body_leaf<T3, tag_value, B3>(b3) body1),
, new internal::function_body_leaf<T2, tag_value, Body2>(
new internal::function_body_leaf<T4, tag_value, B4>(b4) body2),
, new internal::function_body_leaf<T3, tag_value, Body3>(
new internal::function_body_leaf<T5, tag_value, B5>(b5) body3),
, new internal::function_body_leaf<T4, tag_value, Body4>(
new internal::function_body_leaf<T6, tag_value, B6>(b6) body4),
, new internal::function_body_leaf<T5, tag_value, Body5>(
new internal::function_body_leaf<T7, tag_value, B7>(b7) body5),
, new internal::function_body_leaf<T6, tag_value, Body6>(
new internal::function_body_leaf<T8, tag_value, B8>(b8) body6),
, new internal::function_body_leaf<T7, tag_value, Body7>(
new internal::function_body_leaf<T9, tag_value, B9>(b9) body7),
new internal::function_body_leaf<T8, tag_value, Body8>(
body8),
new internal::function_body_leaf<T9, tag_value, Body9>(
body9)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
#endif #endif
//! templated function to refer to input ports of the join node //! templated function to refer to input ports of the join node
template<size_t N, typename JNT> template<size_t N, typename JNT>
typename tbb::flow::tuple_element<N, typename JNT::input_ports_type>::t ype &input_port(JNT &jn) { typename tbb::flow::tuple_element<N, typename JNT::input_ports_type>::t ype &input_port(JNT &jn) {
return tbb::flow::get<N>(jn.input_ports()); return tbb::flow::get<N>(jn.input_ports());
} }
 End of changes. 13 change blocks. 
135 lines changed or deleted 157 lines changed or added


 concurrent_hash_map.h   concurrent_hash_map.h 
skipping to change at line 35 skipping to change at line 35
#if !TBB_USE_EXCEPTIONS && _MSC_VER #if !TBB_USE_EXCEPTIONS && _MSC_VER
// Suppress "C++ exception handler used, but unwind semantics are not e nabled" warning in STL headers // Suppress "C++ exception handler used, but unwind semantics are not e nabled" warning in STL headers
#pragma warning (push) #pragma warning (push)
#pragma warning (disable: 4530) #pragma warning (disable: 4530)
#endif #endif
#include <iterator> #include <iterator>
#include <utility> // Need std::pair #include <utility> // Need std::pair
#include <cstring> // Need std::memset #include <cstring> // Need std::memset
#include <algorithm> // Need std::swap
#if !TBB_USE_EXCEPTIONS && _MSC_VER #if !TBB_USE_EXCEPTIONS && _MSC_VER
#pragma warning (pop) #pragma warning (pop)
#endif #endif
#include "cache_aligned_allocator.h" #include "cache_aligned_allocator.h"
#include "tbb_allocator.h" #include "tbb_allocator.h"
#include "spin_rw_mutex.h" #include "spin_rw_mutex.h"
#include "atomic.h" #include "atomic.h"
#include "tbb_exception.h" #include "tbb_exception.h"
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 concurrent_priority_queue.h   concurrent_priority_queue.h 
skipping to change at line 38 skipping to change at line 38
#include "tbb_profiling.h" #include "tbb_profiling.h"
#include "internal/_aggregator_impl.h" #include "internal/_aggregator_impl.h"
#include <vector> #include <vector>
#include <iterator> #include <iterator>
#include <functional> #include <functional>
#if __TBB_INITIALIZER_LISTS_PRESENT #if __TBB_INITIALIZER_LISTS_PRESENT
#include <initializer_list> #include <initializer_list>
#endif #endif
#if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
#include <type_traits>
#endif
namespace tbb { namespace tbb {
namespace interface5 { namespace interface5 {
namespace internal {
#if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
template<typename T, bool C = std::is_copy_constructible<T>::value>
struct use_element_copy_constructor {
typedef tbb::internal::true_type type;
};
template<typename T>
struct use_element_copy_constructor <T,false> {
typedef tbb::internal::false_type type;
};
#else
template<typename>
struct use_element_copy_constructor {
typedef tbb::internal::true_type type;
};
#endif
} // namespace internal
using namespace tbb::internal; using namespace tbb::internal;
//! Concurrent priority queue //! Concurrent priority queue
template <typename T, typename Compare=std::less<T>, typename A=cache_align ed_allocator<T> > template <typename T, typename Compare=std::less<T>, typename A=cache_align ed_allocator<T> >
class concurrent_priority_queue { class concurrent_priority_queue {
public: public:
//! Element type in the queue. //! Element type in the queue.
typedef T value_type; typedef T value_type;
skipping to change at line 213 skipping to change at line 234
bool empty() const { return size()==0; } bool empty() const { return size()==0; }
//! Returns the current number of elements contained in the queue //! Returns the current number of elements contained in the queue
/** Returned value may not reflect results of pending operations. /** Returned value may not reflect results of pending operations.
This operation reads shared data and will trigger a race condition. */ This operation reads shared data and will trigger a race condition. */
size_type size() const { return __TBB_load_with_acquire(my_size); } size_type size() const { return __TBB_load_with_acquire(my_size); }
//! Pushes elem onto the queue, increasing capacity of queue if necessa ry //! Pushes elem onto the queue, increasing capacity of queue if necessa ry
/** This operation can be safely used concurrently with other push, try _pop or emplace operations. */ /** This operation can be safely used concurrently with other push, try _pop or emplace operations. */
void push(const_reference elem) { void push(const_reference elem) {
#if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
__TBB_STATIC_ASSERT( std::is_copy_constructible<value_type>::value,
"The type is not copy constructible. Copying push operation is impossible.
" );
#endif
cpq_operation op_data(elem, PUSH_OP); cpq_operation op_data(elem, PUSH_OP);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
if (op_data.status == FAILED) // exception thrown if (op_data.status == FAILED) // exception thrown
throw_exception(eid_bad_alloc); throw_exception(eid_bad_alloc);
} }
#if __TBB_CPP11_RVALUE_REF_PRESENT #if __TBB_CPP11_RVALUE_REF_PRESENT
//! Pushes elem onto the queue, increasing capacity of queue if necessa ry //! Pushes elem onto the queue, increasing capacity of queue if necessa ry
/** This operation can be safely used concurrently with other push, try _pop or emplace operations. */ /** This operation can be safely used concurrently with other push, try _pop or emplace operations. */
void push(value_type &&elem) { void push(value_type &&elem) {
skipping to change at line 366 skipping to change at line 390
__TBB_ASSERT(mark<=data.size(), NULL); __TBB_ASSERT(mark<=data.size(), NULL);
} }
else { // no convenient item to pop; postpone else { // no convenient item to pop; postpone
itt_hide_store_word(tmp->next, pop_list); itt_hide_store_word(tmp->next, pop_list);
pop_list = tmp; pop_list = tmp;
} }
} else { // PUSH_OP or PUSH_RVALUE_OP } else { // PUSH_OP or PUSH_RVALUE_OP
__TBB_ASSERT(tmp->type == PUSH_OP || tmp->type == PUSH_RVAL UE_OP, "Unknown operation" ); __TBB_ASSERT(tmp->type == PUSH_OP || tmp->type == PUSH_RVAL UE_OP, "Unknown operation" );
__TBB_TRY{ __TBB_TRY{
if (tmp->type == PUSH_OP) { if (tmp->type == PUSH_OP) {
data.push_back(*(tmp->elem)); push_back_helper(*(tmp->elem), typename internal::u se_element_copy_constructor<value_type>::type());
} else { } else {
data.push_back(move(*(tmp->elem))); data.push_back(move(*(tmp->elem)));
} }
__TBB_store_with_release(my_size, my_size + 1); __TBB_store_with_release(my_size, my_size + 1);
itt_store_word_with_release(tmp->status, uintptr_t(SUCC EEDED)); itt_store_word_with_release(tmp->status, uintptr_t(SUCC EEDED));
} __TBB_CATCH(...) { } __TBB_CATCH(...) {
itt_store_word_with_release(tmp->status, uintptr_t(FAIL ED)); itt_store_word_with_release(tmp->status, uintptr_t(FAIL ED));
} }
} }
} }
skipping to change at line 449 skipping to change at line 473
if (compare(data[target], data[data.size()-1])) break; if (compare(data[target], data[data.size()-1])) break;
data[cur_pos] = move(data[target]); data[cur_pos] = move(data[target]);
cur_pos = target; cur_pos = target;
child = (cur_pos<<1)+1; child = (cur_pos<<1)+1;
} }
if (cur_pos != data.size()-1) if (cur_pos != data.size()-1)
data[cur_pos] = move(data[data.size()-1]); data[cur_pos] = move(data[data.size()-1]);
data.pop_back(); data.pop_back();
if (mark > data.size()) mark = data.size(); if (mark > data.size()) mark = data.size();
} }
void push_back_helper(const T& t, tbb::internal::true_type) {
data.push_back(t);
}
void push_back_helper(const T&, tbb::internal::false_type) {
__TBB_ASSERT( false, "The type is not copy constructible. Copying p
ush operation is impossible." );
}
}; };
} // namespace interface5 } // namespace interface5
using interface5::concurrent_priority_queue; using interface5::concurrent_priority_queue;
} // namespace tbb } // namespace tbb
#endif /* __TBB_concurrent_priority_queue_H */ #endif /* __TBB_concurrent_priority_queue_H */
 End of changes. 5 change blocks. 
1 lines changed or deleted 36 lines changed or added


 concurrent_vector.h   concurrent_vector.h 
skipping to change at line 1074 skipping to change at line 1074
//! Construct n instances of T, starting at "begin". //! Construct n instances of T, starting at "begin".
static void __TBB_EXPORTED_FUNC initialize_array( void* begin, const vo id*, size_type n ); static void __TBB_EXPORTED_FUNC initialize_array( void* begin, const vo id*, size_type n );
//! Copy-construct n instances of T, starting at "begin". //! Copy-construct n instances of T, starting at "begin".
static void __TBB_EXPORTED_FUNC initialize_array_by( void* begin, const void* src, size_type n ); static void __TBB_EXPORTED_FUNC initialize_array_by( void* begin, const void* src, size_type n );
//! Copy-construct n instances of T by copying single element pointed t o by src, starting at "dst". //! Copy-construct n instances of T by copying single element pointed t o by src, starting at "dst".
static void __TBB_EXPORTED_FUNC copy_array( void* dst, const void* src, size_type n ); static void __TBB_EXPORTED_FUNC copy_array( void* dst, const void* src, size_type n );
#if __TBB_MOVE_IF_NOEXCEPT_PRESENT
//! Either opy or move-construct n instances of T, starting at "dst" by
copying according element of src array.
static void __TBB_EXPORTED_FUNC move_array_if_noexcept( void* dst, cons
t void* src, size_type n );
#endif //__TBB_MOVE_IF_NO_EXCEPT_PRESENT
#if __TBB_CPP11_RVALUE_REF_PRESENT #if __TBB_CPP11_RVALUE_REF_PRESENT
//! Move-construct n instances of T, starting at "dst" by copying accor ding element of src array. //! Move-construct n instances of T, starting at "dst" by copying accor ding element of src array.
static void __TBB_EXPORTED_FUNC move_array( void* dst, const void* src, size_type n ); static void __TBB_EXPORTED_FUNC move_array( void* dst, const void* src, size_type n );
//! Move-assign (using operator=) n instances of T, starting at "dst" b y assigning according element of src array. //! Move-assign (using operator=) n instances of T, starting at "dst" b y assigning according element of src array.
static void __TBB_EXPORTED_FUNC move_assign_array( void* dst, const voi d* src, size_type n ); static void __TBB_EXPORTED_FUNC move_assign_array( void* dst, const voi d* src, size_type n );
#endif #endif
//! Copy-construct n instances of T, starting at "dst" by iterator rang e of [p_type_erased_iterator, p_type_erased_iterator+n). //! Copy-construct n instances of T, starting at "dst" by iterator rang e of [p_type_erased_iterator, p_type_erased_iterator+n).
template<typename Iterator> template<typename Iterator>
static void __TBB_EXPORTED_FUNC copy_range( void* dst, const void* p_ty pe_erased_iterator, size_type n ); static void __TBB_EXPORTED_FUNC copy_range( void* dst, const void* p_ty pe_erased_iterator, size_type n );
//! Assign (using operator=) n instances of T, starting at "dst" by ass igning according element of src array. //! Assign (using operator=) n instances of T, starting at "dst" by ass igning according element of src array.
static void __TBB_EXPORTED_FUNC assign_array( void* dst, const void* sr c, size_type n ); static void __TBB_EXPORTED_FUNC assign_array( void* dst, const void* sr c, size_type n );
skipping to change at line 1110 skipping to change at line 1116
internal_loop_guide(size_type ntrials, void *ptr) internal_loop_guide(size_type ntrials, void *ptr)
: array(as_pointer(ptr)), n(ntrials), i(0) {} : array(as_pointer(ptr)), n(ntrials), i(0) {}
void init() { for(; i < n; ++i) new( &array[i] ) T(); } void init() { for(; i < n; ++i) new( &array[i] ) T(); }
void init(const void *src) { for(; i < n; ++i) new( &array[i] ) T(* as_const_pointer(src)); } void init(const void *src) { for(; i < n; ++i) new( &array[i] ) T(* as_const_pointer(src)); }
void copy(const void *src) { for(; i < n; ++i) new( &array[i] ) T(a s_const_pointer(src)[i]); } void copy(const void *src) { for(; i < n; ++i) new( &array[i] ) T(a s_const_pointer(src)[i]); }
void assign(const void *src) { for(; i < n; ++i) array[i] = as_cons t_pointer(src)[i]; } void assign(const void *src) { for(; i < n; ++i) array[i] = as_cons t_pointer(src)[i]; }
#if __TBB_CPP11_RVALUE_REF_PRESENT #if __TBB_CPP11_RVALUE_REF_PRESENT
void move_assign(const void *src) { for(; i < n; ++i) array[i ] = std::move(as_pointer(src)[i]); } void move_assign(const void *src) { for(; i < n; ++i) array[i ] = std::move(as_pointer(src)[i]); }
void move_construct(const void *src) { for(; i < n; ++i) new( &a rray[i] ) T( std::move(as_pointer(src)[i]) ); } void move_construct(const void *src) { for(; i < n; ++i) new( &a rray[i] ) T( std::move(as_pointer(src)[i]) ); }
#endif #endif
#if __TBB_MOVE_IF_NOEXCEPT_PRESENT
void move_construct_if_noexcept(const void *src) { for(; i < n;
++i) new( &array[i] ) T( std::move_if_noexcept(as_pointer(src)[i]) ); }
#endif //__TBB_MOVE_IF_NOEXCEPT_PRESENT
//TODO: rename to construct_range //TODO: rename to construct_range
template<class I> void iterate(I &src) { for(; i < n; ++i, ++src) n ew( &array[i] ) T( *src ); } template<class I> void iterate(I &src) { for(; i < n; ++i, ++src) n ew( &array[i] ) T( *src ); }
~internal_loop_guide() { ~internal_loop_guide() {
if(i < n) {// if an exception was raised, fill the rest of item s with zeros if(i < n) {// if an exception was raised, fill the rest of item s with zeros
internal::handle_unconstructed_elements(array+i, n-i); internal::handle_unconstructed_elements(array+i, n-i);
} }
} }
}; };
struct push_back_helper : internal::no_copy{ struct push_back_helper : internal::no_copy{
skipping to change at line 1157 skipping to change at line 1167
}; };
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
#pragma warning (push) #pragma warning (push)
#pragma warning (disable: 4701) // potentially uninitialized local variable "old" #pragma warning (disable: 4701) // potentially uninitialized local variable "old"
#endif #endif
template<typename T, class A> template<typename T, class A>
void concurrent_vector<T, A>::shrink_to_fit() { void concurrent_vector<T, A>::shrink_to_fit() {
internal_segments_table old; internal_segments_table old;
__TBB_TRY { __TBB_TRY {
if( internal_compact( sizeof(T), &old, &destroy_array, &copy_array internal_array_op2 copy_or_move_array =
) ) #if __TBB_MOVE_IF_NOEXCEPT_PRESENT
&move_array_if_noexcept
#else
&copy_array
#endif
;
if( internal_compact( sizeof(T), &old, &destroy_array, copy_or_move
_array ) )
internal_free_segments( old.table, pointers_per_long_table, old .first_block ); // free joined and unnecessary segments internal_free_segments( old.table, pointers_per_long_table, old .first_block ); // free joined and unnecessary segments
} __TBB_CATCH(...) { } __TBB_CATCH(...) {
if( old.first_block ) // free segment allocated for compacting. Onl y for support of exceptions in ctor of user T[ype] if( old.first_block ) // free segment allocated for compacting. Onl y for support of exceptions in ctor of user T[ype]
internal_free_segments( old.table, 1, old.first_block ); internal_free_segments( old.table, 1, old.first_block );
__TBB_RETHROW(); __TBB_RETHROW();
} }
} }
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
#pragma warning (pop) #pragma warning (pop)
#endif // warning 4701 is back #endif // warning 4701 is back
skipping to change at line 1264 skipping to change at line 1281
template<typename T, class A> template<typename T, class A>
void concurrent_vector<T, A>::copy_array( void* dst, const void* src, size_ type n ) { void concurrent_vector<T, A>::copy_array( void* dst, const void* src, size_ type n ) {
internal_loop_guide loop(n, dst); loop.copy(src); internal_loop_guide loop(n, dst); loop.copy(src);
} }
#if __TBB_CPP11_RVALUE_REF_PRESENT #if __TBB_CPP11_RVALUE_REF_PRESENT
template<typename T, class A> template<typename T, class A>
void concurrent_vector<T, A>::move_array( void* dst, const void* src, size_ type n ) { void concurrent_vector<T, A>::move_array( void* dst, const void* src, size_ type n ) {
internal_loop_guide loop(n, dst); loop.move_construct(src); internal_loop_guide loop(n, dst); loop.move_construct(src);
} }
template<typename T, class A> template<typename T, class A>
void concurrent_vector<T, A>::move_assign_array( void* dst, const void* src , size_type n ) { void concurrent_vector<T, A>::move_assign_array( void* dst, const void* src , size_type n ) {
internal_loop_guide loop(n, dst); loop.move_assign(src); internal_loop_guide loop(n, dst); loop.move_assign(src);
} }
#endif #endif
#if __TBB_MOVE_IF_NOEXCEPT_PRESENT
template<typename T, class A>
void concurrent_vector<T, A>::move_array_if_noexcept( void* dst, const void
* src, size_type n ) {
internal_loop_guide loop(n, dst); loop.move_construct_if_noexcept(src);
}
#endif //__TBB_MOVE_IF_NOEXCEPT_PRESENT
template<typename T, class A> template<typename T, class A>
template<typename I> template<typename I>
void concurrent_vector<T, A>::copy_range( void* dst, const void* p_type_era sed_iterator, size_type n ){ void concurrent_vector<T, A>::copy_range( void* dst, const void* p_type_era sed_iterator, size_type n ){
I & iterator ((*const_cast<I*>(static_cast<const I*>(p_type_erased_iter ator)))); I & iterator ((*const_cast<I*>(static_cast<const I*>(p_type_erased_iter ator))));
internal_loop_guide loop(n, dst); loop.iterate(iterator); internal_loop_guide loop(n, dst); loop.iterate(iterator);
} }
template<typename T, class A> template<typename T, class A>
void concurrent_vector<T, A>::assign_array( void* dst, const void* src, siz e_type n ) { void concurrent_vector<T, A>::assign_array( void* dst, const void* src, siz e_type n ) {
internal_loop_guide loop(n, dst); loop.assign(src); internal_loop_guide loop(n, dst); loop.assign(src);
 End of changes. 6 change blocks. 
3 lines changed or deleted 30 lines changed or added


 enumerable_thread_specific.h   enumerable_thread_specific.h 
skipping to change at line 635 skipping to change at line 635
virtual void construct(void* where) = 0; virtual void construct(void* where) = 0;
}; };
template <typename T, typename Constructor> template <typename T, typename Constructor>
class callback_leaf: public callback_base<T>, Constructor { class callback_leaf: public callback_base<T>, Constructor {
template<typename X> callback_leaf( const X& x ) : Constructor( x) {} template<typename X> callback_leaf( const X& x ) : Constructor( x) {}
typedef typename tbb::tbb_allocator<callback_leaf> my_allocator _type; typedef typename tbb::tbb_allocator<callback_leaf> my_allocator _type;
/*override*/ callback_base<T>* clone() { /*override*/ callback_base<T>* clone() {
void* where = my_allocator_type().allocate(1); return make(*this);
return new(where) callback_leaf(*this);
} }
/*override*/ void destroy() { /*override*/ void destroy() {
my_allocator_type().destroy(this); my_allocator_type().destroy(this);
my_allocator_type().deallocate(this,1); my_allocator_type().deallocate(this,1);
} }
/*override*/ void construct(void* where) { /*override*/ void construct(void* where) {
Constructor::construct(where); Constructor::construct(where);
} }
skipping to change at line 770 skipping to change at line 769
// Iterator types // Iterator types
typedef typename internal::enumerable_thread_specific_iterator< int ernal_collection_type, value_type > iterator; typedef typename internal::enumerable_thread_specific_iterator< int ernal_collection_type, value_type > iterator;
typedef typename internal::enumerable_thread_specific_iterator< int ernal_collection_type, const value_type > const_iterator; typedef typename internal::enumerable_thread_specific_iterator< int ernal_collection_type, const value_type > const_iterator;
// Parallel range types // Parallel range types
typedef generic_range_type< iterator > range_type; typedef generic_range_type< iterator > range_type;
typedef generic_range_type< const_iterator > const_range_type; typedef generic_range_type< const_iterator > const_range_type;
//! Default constructor. Each local instance of T is default const ructed. //! Default constructor. Each local instance of T is default const ructed.
enumerable_thread_specific() : enumerable_thread_specific() : my_construct_callback(
my_construct_callback( internal::callback_leaf<T,internal::cons internal::callback_leaf<T,internal::construct_by_default<T> >::
truct_by_default<T> >::make(/*dummy argument*/0) ) make(/*dummy argument*/0)
{} ){}
//! Constructor with initializer functor. Each local instance of T is constructed by T(finit()). //! Constructor with initializer functor. Each local instance of T is constructed by T(finit()).
template <typename Finit> template <typename Finit>
enumerable_thread_specific( Finit finit ) : enumerable_thread_specific( Finit finit ) : my_construct_callback(
my_construct_callback( internal::callback_leaf<T,internal::cons internal::callback_leaf<T,internal::construct_by_finit<T,Finit>
truct_by_finit<T,Finit> >::make( finit ) ) >::make( finit )
{} ){}
//! Constructor with exemplar. Each local instance of T is copied- //! Constructor with exemplar. Each local instance of T is copy-con
constructed from the exemplar. structed from the exemplar.
enumerable_thread_specific(const T& exemplar) : enumerable_thread_specific( const T& exemplar ) : my_construct_call
my_construct_callback( internal::callback_leaf<T,internal::cons back(
truct_by_exemplar<T> >::make( exemplar ) ) internal::callback_leaf<T,internal::construct_by_exemplar<T> >:
{} :make( exemplar )
){}
//! Destructor //! Destructor
~enumerable_thread_specific() { ~enumerable_thread_specific() {
my_construct_callback->destroy(); my_construct_callback->destroy();
this->clear(); // deallocation before the derived class is fin ished destructing this->clear(); // deallocation before the derived class is fin ished destructing
// So free(array *) is still accessible // So free(array *) is still accessible
} }
//! returns reference to local, discarding exists //! returns reference to local, discarding exists
reference local() { reference local() {
skipping to change at line 838 skipping to change at line 837
void clear() { void clear() {
unconstruct_locals(); unconstruct_locals();
my_locals.clear(); my_locals.clear();
this->table_clear(); this->table_clear();
// callback is not destroyed // callback is not destroyed
// exemplar is not destroyed // exemplar is not destroyed
} }
private: private:
template<typename U, typename A2, ets_key_usage_type C2> template<typename A2, ets_key_usage_type C2>
void internal_copy( const enumerable_thread_specific<U, A2, C2>& ot void internal_copy( const enumerable_thread_specific<T, A2, C2>& ot
her); her);
public: public:
template<typename U, typename Alloc, ets_key_usage_type Cachetype> template<typename Alloc, ets_key_usage_type Cachetype>
enumerable_thread_specific( const enumerable_thread_specific<U, All enumerable_thread_specific( const enumerable_thread_specific<T, All
oc, Cachetype>& other ) : internal::ets_base<ETS_key_type> () oc, Cachetype>& other ) : internal::ets_base<ETS_key_type> ()
{ {
internal_copy(other); internal_copy(other);
} }
enumerable_thread_specific( const enumerable_thread_specific& other ) : internal::ets_base<ETS_key_type> () enumerable_thread_specific( const enumerable_thread_specific& other ) : internal::ets_base<ETS_key_type> ()
{ {
internal_copy(other); internal_copy(other);
} }
private: private:
template<typename U, typename A2, ets_key_usage_type C2> template<typename A2, ets_key_usage_type C2>
enumerable_thread_specific & enumerable_thread_specific &
internal_assign(const enumerable_thread_specific<U, A2, C2>& other) { internal_assign(const enumerable_thread_specific<T, A2, C2>& other) {
if(static_cast<void *>( this ) != static_cast<const void *>( &o ther )) { if(static_cast<void *>( this ) != static_cast<const void *>( &o ther )) {
this->clear(); this->clear();
my_construct_callback->destroy(); my_construct_callback->destroy();
my_construct_callback = 0; my_construct_callback = 0;
internal_copy( other ); internal_copy( other );
} }
return *this; return *this;
} }
public: public:
// assignment // assignment
enumerable_thread_specific& operator=(const enumerable_thread_speci fic& other) { enumerable_thread_specific& operator=(const enumerable_thread_speci fic& other) {
return internal_assign(other); return internal_assign(other);
} }
template<typename U, typename Alloc, ets_key_usage_type Cachetype> template<typename Alloc, ets_key_usage_type Cachetype>
enumerable_thread_specific& operator=(const enumerable_thread_speci enumerable_thread_specific& operator=(const enumerable_thread_speci
fic<U, Alloc, Cachetype>& other) fic<T, Alloc, Cachetype>& other)
{ {
return internal_assign(other); return internal_assign(other);
} }
// combine_func_t has signature T(T,T) or T(const T&, const T&) // combine_func_t has signature T(T,T) or T(const T&, const T&)
template <typename combine_func_t> template <typename combine_func_t>
T combine(combine_func_t f_combine) { T combine(combine_func_t f_combine) {
if(begin() == end()) { if(begin() == end()) {
internal::destruct_only<T> location; internal::destruct_only<T> location;
my_construct_callback->construct(location.value.begin()); my_construct_callback->construct(location.value.begin());
skipping to change at line 907 skipping to change at line 906
template <typename combine_func_t> template <typename combine_func_t>
void combine_each(combine_func_t f_combine) { void combine_each(combine_func_t f_combine) {
for(const_iterator ci = begin(); ci != end(); ++ci) { for(const_iterator ci = begin(); ci != end(); ++ci) {
f_combine( *ci ); f_combine( *ci );
} }
} }
}; // enumerable_thread_specific }; // enumerable_thread_specific
template <typename T, typename Allocator, ets_key_usage_type ETS_key_ty pe> template <typename T, typename Allocator, ets_key_usage_type ETS_key_ty pe>
template<typename U, typename A2, ets_key_usage_type C2> template<typename A2, ets_key_usage_type C2>
void enumerable_thread_specific<T,Allocator,ETS_key_type>::internal_cop void enumerable_thread_specific<T,Allocator,ETS_key_type>::internal_cop
y( const enumerable_thread_specific<U, A2, C2>& other) { y( const enumerable_thread_specific<T, A2, C2>& other) {
// Initialize my_construct_callback first, so that it is valid even if rest of this routine throws an exception. // Initialize my_construct_callback first, so that it is valid even if rest of this routine throws an exception.
my_construct_callback = other.my_construct_callback->clone(); my_construct_callback = other.my_construct_callback->clone();
typedef internal::ets_base<ets_no_key> base; typedef internal::ets_base<ets_no_key> base;
__TBB_ASSERT(my_locals.size()==0,NULL); __TBB_ASSERT(my_locals.size()==0,NULL);
this->table_reserve_for_copy( other ); this->table_reserve_for_copy( other );
for( base::array* r=other.my_root; r; r=r->next ) { for( base::array* r=other.my_root; r; r=r->next ) {
for( size_t i=0; i<r->size(); ++i ) { for( size_t i=0; i<r->size(); ++i ) {
base::slot& s1 = r->at(i); base::slot& s1 = r->at(i);
if( !s1.empty() ) { if( !s1.empty() ) {
base::slot& s2 = this->table_find(s1.key); base::slot& s2 = this->table_find(s1.key);
if( s2.empty() ) { if( s2.empty() ) {
void* lref = &*my_locals.grow_by(1); void* lref = &*my_locals.grow_by(1);
s2.ptr = new(lref) T(*(U*)s1.ptr); s2.ptr = new(lref) T(*(T*)s1.ptr);
s2.key = s1.key; s2.key = s1.key;
} else { } else {
// Skip the duplicate // Skip the duplicate
} }
} }
} }
} }
} }
template< typename Container > template< typename Container >
 End of changes. 10 change blocks. 
32 lines changed or deleted 32 lines changed or added


 flow_graph.h   flow_graph.h 
skipping to change at line 997 skipping to change at line 997
class function_node : public graph_node, public internal::function_input<In put,Output,Allocator>, public internal::function_output<Output> { class function_node : public graph_node, public internal::function_input<In put,Output,Allocator>, public internal::function_output<Output> {
protected: protected:
using graph_node::my_graph; using graph_node::my_graph;
public: public:
typedef Input input_type; typedef Input input_type;
typedef Output output_type; typedef Output output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type; typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type;
typedef internal::function_output<output_type> fOutput_type; typedef internal::function_output<output_type> fOutput_type;
#if TBB_PREVIEW_FLOW_GRAPH_FEAURES #if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef std::vector<predecessor_type *> predecessor_vector_type; using typename internal::function_input<Input,Output,Allocator>::predec
typedef std::vector<successor_type *> successor_vector_type; essor_vector_type;
using typename internal::function_output<Output>::successor_vector_type
;
#endif #endif
//! Constructor //! Constructor
template< typename Body > template< typename Body >
function_node( graph &g, size_t concurrency, Body body ) : function_node( graph &g, size_t concurrency, Body body ) :
graph_node(g), internal::function_input<input_type,output_type,Allo cator>(g, concurrency, body) { graph_node(g), internal::function_input<input_type,output_type,Allo cator>(g, concurrency, body) {
tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NOD E, &this->graph_node::my_graph, static_cast<receiver<input_type> *>(this), tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NOD E, &this->graph_node::my_graph, static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this), this->my_body ); static_cast<sender<output_type> *>(this), this->my_body );
} }
skipping to change at line 1057 skipping to change at line 1057
using graph_node::my_graph; using graph_node::my_graph;
public: public:
typedef Input input_type; typedef Input input_type;
typedef Output output_type; typedef Output output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type; typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type;
typedef internal::function_input_queue<input_type, Allocator> queue_typ e; typedef internal::function_input_queue<input_type, Allocator> queue_typ e;
typedef internal::function_output<output_type> fOutput_type; typedef internal::function_output<output_type> fOutput_type;
#if TBB_PREVIEW_FLOW_GRAPH_FEATURES #if TBB_PREVIEW_FLOW_GRAPH_FEATURES
typedef std::vector<predecessor_type *> predecessor_vector_type; using typename internal::function_input<Input,Output,Allocator>::predec
typedef std::vector<successor_type *> successor_vector_type; essor_vector_type;
using typename internal::function_output<Output>::successor_vector_type
;
#endif #endif
//! Constructor //! Constructor
template< typename Body > template< typename Body >
function_node( graph &g, size_t concurrency, Body body ) : function_node( graph &g, size_t concurrency, Body body ) :
graph_node(g), fInput_type( g, concurrency, body, new queue_type() ) { graph_node(g), fInput_type( g, concurrency, body, new queue_type() ) {
tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NOD E, &this->graph_node::my_graph, static_cast<receiver<input_type> *>(this), tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NOD E, &this->graph_node::my_graph, static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this), this->my_body ); static_cast<sender<output_type> *>(this), this->my_body );
} }
skipping to change at line 2283 skipping to change at line 2283
case buffer_node<T, A>::add_blt_pred: this->internal_add_built_ pred(tmp); break; case buffer_node<T, A>::add_blt_pred: this->internal_add_built_ pred(tmp); break;
case buffer_node<T, A>::del_blt_pred: this->internal_del_built_ pred(tmp); break; case buffer_node<T, A>::del_blt_pred: this->internal_del_built_ pred(tmp); break;
case buffer_node<T, A>::blt_succ_cnt: this->internal_succ_cnt(t mp); break; case buffer_node<T, A>::blt_succ_cnt: this->internal_succ_cnt(t mp); break;
case buffer_node<T, A>::blt_pred_cnt: this->internal_pred_cnt(t mp); break; case buffer_node<T, A>::blt_pred_cnt: this->internal_pred_cnt(t mp); break;
case buffer_node<T, A>::blt_succ_cpy: this->internal_copy_succs (tmp); break; case buffer_node<T, A>::blt_succ_cpy: this->internal_copy_succs (tmp); break;
case buffer_node<T, A>::blt_pred_cpy: this->internal_copy_preds (tmp); break; case buffer_node<T, A>::blt_pred_cpy: this->internal_copy_preds (tmp); break;
#endif #endif
} }
} }
// process pops! for now, no special pop processing // process pops! for now, no special pop processing
// concurrent_priority_queue handles pushes first, then pops.
// that is the genesis of this comment
if (mark<this->my_tail) heapify(); if (mark<this->my_tail) heapify();
if (try_forwarding && !this->forwarder_busy) { __TBB_ASSERT(mark == this->my_tail, "mark unequal after heapify");
if (try_forwarding && !this->forwarder_busy) { // could we also te
st for this->my_tail (queue non-empty)?
task* tp = this->my_graph.root_task(); task* tp = this->my_graph.root_task();
if(tp) { if(tp) {
this->forwarder_busy = true; this->forwarder_busy = true;
task *new_task = new(task::allocate_additional_child_of(*tp )) internal:: task *new_task = new(task::allocate_additional_child_of(*tp )) internal::
forward_task_bypass forward_task_bypass
< buffer_node<input_type, A> >(*this); < buffer_node<input_type, A> >(*this);
// tmp should point to the last item handled by the aggrega tor. This is the operation // tmp should point to the last item handled by the aggrega tor. This is the operation
// the handling thread enqueued. So modifying that record will be okay. // the handling thread enqueued. So modifying that record will be okay.
tbb::task *tmp1 = tmp->ltask; tbb::task *tmp1 = tmp->ltask;
tmp->ltask = combine_tasks(tmp1, new_task); tmp->ltask = combine_tasks(tmp1, new_task);
skipping to change at line 2312 skipping to change at line 2315
task * last_task = NULL; // flagged when a successor accepts task * last_task = NULL; // flagged when a successor accepts
size_type counter = this->my_successors.size(); size_type counter = this->my_successors.size();
if (this->my_reserved || this->my_tail == 0) { if (this->my_reserved || this->my_tail == 0) {
__TBB_store_with_release(op->status, FAILED); __TBB_store_with_release(op->status, FAILED);
this->forwarder_busy = false; this->forwarder_busy = false;
return; return;
} }
// Keep trying to send while there exists an accepting successor // Keep trying to send while there exists an accepting successor
while (counter>0 && this->my_tail > 0) { while (counter>0 && this->my_tail > 0) {
i_copy = this->get_my_item(0); prio_copy(i_copy);
task * new_task = this->my_successors.try_put_task(i_copy); task * new_task = this->my_successors.try_put_task(i_copy);
if ( new_task ) { if ( new_task ) {
last_task = combine_tasks(last_task, new_task); last_task = combine_tasks(last_task, new_task);
this->destroy_item(0); // we've forwarded this item prio_pop();
if (mark == this->my_tail) --mark;
if(--(this->my_tail)) { // didn't consume last item on heap
this->move_item(0,this->my_tail);
}
if (this->my_tail > 1) // don't reheap for heap of size 1
reheap();
} }
--counter; --counter;
} }
op->ltask = last_task; op->ltask = last_task;
if (last_task && !counter) if (last_task && !counter)
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
else { else {
__TBB_store_with_release(op->status, FAILED); __TBB_store_with_release(op->status, FAILED);
this->forwarder_busy = false; this->forwarder_busy = false;
} }
} }
/* override */ void internal_push(prio_operation *op) { /* override */ void internal_push(prio_operation *op) {
if ( this->my_tail >= this->my_array_size ) prio_push(*(op->elem));
this->grow_my_array( this->my_tail + 1 );
(void) this->place_item(this->my_tail, *(op->elem));
++(this->my_tail);
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
} }
/* override */ void internal_pop(prio_operation *op) { /* override */ void internal_pop(prio_operation *op) {
// if empty or already reserved, don't pop // if empty or already reserved, don't pop
if ( this->my_reserved == true || this->my_tail == 0 ) { if ( this->my_reserved == true || this->my_tail == 0 ) {
__TBB_store_with_release(op->status, FAILED); __TBB_store_with_release(op->status, FAILED);
return; return;
} }
if (mark<this->my_tail && // item pushed, no re-heap
compare(this->get_my_item(0), prio_copy(*(op->elem));
this->get_my_item(this->my_tail-1))) {
// there are newly pushed elems; last one higher than top
// copy the data
this->fetch_item(this->my_tail-1, *(op->elem));
__TBB_store_with_release(op->status, SUCCEEDED);
--(this->my_tail);
return;
}
// extract and push the last element down heap
*(op->elem) = this->get_my_item(0); // copy the data, item 0 still
valid
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
if (mark == this->my_tail) --mark; prio_pop();
__TBB_ASSERT(this->my_item_valid(this->my_tail - 1), NULL);
if(--(this->my_tail)) {
// there were two or more items in heap. Move the
// last item to the top of the heap
this->set_my_item(0,this->get_my_item(this->my_tail));
}
this->destroy_item(this->my_tail);
if (this->my_tail > 1) // don't reheap for heap of size 1
reheap();
} }
// pops the highest-priority item, saves copy
/* override */ void internal_reserve(prio_operation *op) { /* override */ void internal_reserve(prio_operation *op) {
if (this->my_reserved == true || this->my_tail == 0) { if (this->my_reserved == true || this->my_tail == 0) {
__TBB_store_with_release(op->status, FAILED); __TBB_store_with_release(op->status, FAILED);
return; return;
} }
this->my_reserved = true; this->my_reserved = true;
*(op->elem) = reserved_item = this->get_my_item(0); prio_copy(*(op->elem));
if (mark == this->my_tail) --mark; reserved_item = *(op->elem);
--(this->my_tail);
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
this->set_my_item(0, this->get_my_item(this->my_tail)); prio_pop();
this->destroy_item(this->my_tail);
if (this->my_tail > 1)
reheap();
} }
/* override */ void internal_consume(prio_operation *op) { /* override */ void internal_consume(prio_operation *op) {
this->my_reserved = false;
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
this->my_reserved = false;
reserved_item = input_type();
} }
/* override */ void internal_release(prio_operation *op) { /* override */ void internal_release(prio_operation *op) {
if (this->my_tail >= this->my_array_size)
this->grow_my_array( this->my_tail + 1 );
this->set_my_item(this->my_tail, reserved_item);
++(this->my_tail);
this->my_reserved = false;
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
heapify(); prio_push(reserved_item);
this->my_reserved = false;
reserved_item = input_type();
} }
private: private:
Compare compare; Compare compare;
size_type mark; size_type mark;
input_type reserved_item; input_type reserved_item;
// in case a reheap has not been done after a push, check if the mark i
tem is higher than the 0'th item
bool prio_use_tail() {
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds before tes
t");
return mark < this->my_tail && compare(this->get_my_item(0), this->
get_my_item(this->my_tail - 1));
}
// prio_push: checks that the item will fit, expand array if necessary,
put at end
void prio_push(const T &src) {
if ( this->my_tail >= this->my_array_size )
this->grow_my_array( this->my_tail + 1 );
(void) this->place_item(this->my_tail, src);
++(this->my_tail);
__TBB_ASSERT(mark < this->my_tail, "mark outside bounds after push"
);
}
// prio_pop: deletes highest priority item from the array, and if it is
item
// 0, move last item to 0 and reheap. If end of array, just destroy an
d decrement tail
// and mark. Assumes the array has already been tested for emptiness;
no failure.
void prio_pop() {
if (prio_use_tail()) {
// there are newly pushed elems; last one higher than top
// copy the data
this->destroy_item(this->my_tail-1);
--(this->my_tail);
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds after
pop");
return;
}
this->destroy_item(0);
if(this->my_tail > 1) {
// push the last element down heap
__TBB_ASSERT(this->my_item_valid(this->my_tail - 1), NULL);
this->move_item(0,this->my_tail - 1);
}
--(this->my_tail);
if(mark > this->my_tail) --mark;
if (this->my_tail > 1) // don't reheap for heap of size 1
reheap();
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds after pop"
);
}
void prio_copy(T &res) {
if (prio_use_tail()) {
res = this->get_my_item(this->my_tail - 1);
}
else {
res = this->get_my_item(0);
}
}
// turn array into heap // turn array into heap
void heapify() { void heapify() {
if(this->my_tail == 0) {
mark = 0;
return;
}
if (!mark) mark = 1; if (!mark) mark = 1;
for (; mark<this->my_tail; ++mark) { // for each unheaped element for (; mark<this->my_tail; ++mark) { // for each unheaped element
size_type cur_pos = mark; size_type cur_pos = mark;
input_type to_place; input_type to_place;
this->fetch_item(mark,to_place); this->fetch_item(mark,to_place);
do { // push to_place up the heap do { // push to_place up the heap
size_type parent = (cur_pos-1)>>1; size_type parent = (cur_pos-1)>>1;
if (!compare(this->get_my_item(parent), to_place)) if (!compare(this->get_my_item(parent), to_place))
break; break;
this->move_item(cur_pos, parent); this->move_item(cur_pos, parent);
 End of changes. 20 change blocks. 
55 lines changed or deleted 95 lines changed or added


 gcc_ia32_common.h   gcc_ia32_common.h 
skipping to change at line 31 skipping to change at line 31
#ifndef __TBB_machine_gcc_ia32_common_H #ifndef __TBB_machine_gcc_ia32_common_H
#define __TBB_machine_gcc_ia32_common_H #define __TBB_machine_gcc_ia32_common_H
//TODO: Add a higher-level function, e.g. tbb::interal::log2(), into tbb_st ddef.h, which //TODO: Add a higher-level function, e.g. tbb::interal::log2(), into tbb_st ddef.h, which
//uses __TBB_Log2 and contains the assert and remove the assert from here a nd all other //uses __TBB_Log2 and contains the assert and remove the assert from here a nd all other
//platform-specific headers. //platform-specific headers.
//TODO: Check if use of gcc intrinsic gives a better chance for cross call optimizations //TODO: Check if use of gcc intrinsic gives a better chance for cross call optimizations
template <typename T> template <typename T>
static inline intptr_t __TBB_machine_lg( T x ) { static inline intptr_t __TBB_machine_lg( T x ) {
__TBB_ASSERT(x>0, "The logarithm of a non-positive value is undefined." ); __TBB_ASSERT(x>0, "The logarithm of a non-positive value is undefined." );
uintptr_t j; uintptr_t j, i = x;
__asm__("bsr %1,%0" : "=r"(j) : "r"((uintptr_t)x)); __asm__("bsr %1,%0" : "=r"(j) : "r"(i));
return j; return j;
} }
#define __TBB_Log2(V) __TBB_machine_lg(V) #define __TBB_Log2(V) __TBB_machine_lg(V)
#ifndef __TBB_Pause #ifndef __TBB_Pause
//TODO: check if raising a ratio of pause instructions to loop control inst ructions //TODO: check if raising a ratio of pause instructions to loop control inst ructions
//(via e.g. loop unrolling) gives any benefit for HT. E.g, the current imp lementation //(via e.g. loop unrolling) gives any benefit for HT. E.g, the current imp lementation
//does about 2 CPU-consuming instructions for every pause instruction. Per haps for //does about 2 CPU-consuming instructions for every pause instruction. Per haps for
//high pause counts it should use an unrolled loop to raise the ratio, and thus free //high pause counts it should use an unrolled loop to raise the ratio, and thus free
//up more integer cycles for the other hyperthread. On the other hand, if the loop is //up more integer cycles for the other hyperthread. On the other hand, if the loop is
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 tbb_config.h   tbb_config.h 
skipping to change at line 129 skipping to change at line 129
/*ICC 12.1 Upd 10 and 13 beta Upd 2 fixed exception_ptr linking issue*/ \ /*ICC 12.1 Upd 10 and 13 beta Upd 2 fixed exception_ptr linking issue*/ \
|| (__INTEL_COMPILER == 1300 && __INTEL_COMPILER_BUILD_DATE >= 20120530) \ || (__INTEL_COMPILER == 1300 && __INTEL_COMPILER_BUILD_DATE >= 20120530) \
|| (__INTEL_COMPILER == 1210 && __INTEL_COMPILER_BUILD_DATE >= 20120410) ) || (__INTEL_COMPILER == 1210 && __INTEL_COMPILER_BUILD_DATE >= 20120410) )
/** libstdc++ that comes with GCC 4.6 use C++11 features not supported by ICC 12.1. /** libstdc++ that comes with GCC 4.6 use C++11 features not supported by ICC 12.1.
* Because of that ICC 12.1 does not support C++11 mode with with gcc 4.6 (or higher), * Because of that ICC 12.1 does not support C++11 mode with with gcc 4.6 (or higher),
* and therefore does not define __GXX_EXPERIMENTAL_CXX0X__ macro **/ * and therefore does not define __GXX_EXPERIMENTAL_CXX0X__ macro **/
#elif __TBB_GCC_VERSION >= 40404 && __TBB_GCC_VERSION < 40600 #elif __TBB_GCC_VERSION >= 40404 && __TBB_GCC_VERSION < 40600
#define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __INTEL_COMPILER >= 1200) #define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __INTEL_COMPILER >= 1200)
#elif __TBB_GCC_VERSION >= 40600 #elif __TBB_GCC_VERSION >= 40600
#define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __INTEL_COMPILER >= 1300) #define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __INTEL_COMPILER >= 1300)
#elif _LIBCPP_VERSION
#define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CX
X0X__
#else #else
#define __TBB_EXCEPTION_PTR_PRESENT 0 #define __TBB_EXCEPTION_PTR_PRESENT 0
#endif #endif
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1700 || (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40600))
#define __TBB_STATIC_ASSERT_PRESENT (__INTEL_CXX11_MODE__ || _MSC_VER >= 1600) #define __TBB_STATIC_ASSERT_PRESENT (__INTEL_CXX11_MODE__ || _MSC_VER >= 1600)
#define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600 || (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300)) #define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600 || (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40300))
/**Intel C++ compiler 14.0 crashes on using __has_include. When it fixe d, condition will need to be updated. **/ /**Intel C++ compiler 14.0 crashes on using __has_include. When it fixe d, condition will need to be updated. **/
#if (__clang__ && __INTEL_COMPILER > 1400) #if (__clang__ && __INTEL_COMPILER > 1400)
#if (__has_feature(__cxx_generalized_initializers__) && __has_inclu de(<initializer_list>)) #if (__has_feature(__cxx_generalized_initializers__) && __has_inclu de(<initializer_list>))
#define __TBB_INITIALIZER_LISTS_PRESENT 1 #define __TBB_INITIALIZER_LISTS_PRESENT 1
#endif #endif
#else #else
/** TODO: when MSVC2013 is supported by Intel C++ compiler, it will be enabled silently by compiler, so rule will need to be updated.**/ /** TODO: when MSVC2013 is supported by Intel C++ compiler, it will be enabled silently by compiler, so rule will need to be updated.**/
#define __TBB_INITIALIZER_LISTS_PRESENT __INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1400 && (_MSC_VER >= 1800 || __TBB_GCC_VERSION >= 40 400 || _LIBCPP_VERSION) #define __TBB_INITIALIZER_LISTS_PRESENT __INTEL_CXX11_MODE__ && __INTEL_COMPILER >= 1400 && (_MSC_VER >= 1800 || __TBB_GCC_VERSION >= 40 400 || _LIBCPP_VERSION)
skipping to change at line 160 skipping to change at line 161
#define __TBB_CPP11_AUTO_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210) #define __TBB_CPP11_AUTO_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210)
#define __TBB_CPP11_DECLTYPE_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210) #define __TBB_CPP11_DECLTYPE_PRESENT (_MSC_VER >= 1600 || __GXX_EXPERIMENTAL_CXX0X__ && __INTEL_COMPILER >= 1210)
#elif __clang__ #elif __clang__
//TODO: these options need to be rechecked //TODO: these options need to be rechecked
/** on OS X* the only way to get C++11 is to use clang. For library feature s (e.g. exception_ptr) libc++ is also /** on OS X* the only way to get C++11 is to use clang. For library feature s (e.g. exception_ptr) libc++ is also
* required. So there is no need to check GCC version for clang**/ * required. So there is no need to check GCC version for clang**/
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__has_feature(__cxx _variadic_templates__)) #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__has_feature(__cxx _variadic_templates__))
#define __TBB_CPP11_RVALUE_REF_PRESENT (__has_feature(__cxx _rvalue_references__) && (__TBB_GCC_VERSION >= 40300 || _LIBCPP_VERSION)) #define __TBB_CPP11_RVALUE_REF_PRESENT (__has_feature(__cxx _rvalue_references__) && (__TBB_GCC_VERSION >= 40300 || _LIBCPP_VERSION))
/** TODO: extend exception_ptr related conditions to cover libstdc++ **/ /** TODO: extend exception_ptr related conditions to cover libstdc++ **/
#define __TBB_EXCEPTION_PTR_PRESENT (__cplusplus >= 20110 3L && _LIBCPP_VERSION) #define __TBB_EXCEPTION_PTR_PRESENT (__cplusplus >= 20110 3L && _LIBCPP_VERSION)
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__cplusplus >= 20110 3L && _LIBCPP_VERSION)
#define __TBB_STATIC_ASSERT_PRESENT __has_feature(__cxx_s tatic_assert__) #define __TBB_STATIC_ASSERT_PRESENT __has_feature(__cxx_s tatic_assert__)
/**Clang (preprocessor) has problems with dealing with expression havin g __has_include in #ifs /**Clang (preprocessor) has problems with dealing with expression havin g __has_include in #ifs
* used inside C++ code. (At least version that comes with OS X 10.8 : Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)) **/ * used inside C++ code. (At least version that comes with OS X 10.8 : Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)) **/
#if (__GXX_EXPERIMENTAL_CXX0X__ && __has_include(<tuple>)) #if (__GXX_EXPERIMENTAL_CXX0X__ && __has_include(<tuple>))
#define __TBB_CPP11_TUPLE_PRESENT 1 #define __TBB_CPP11_TUPLE_PRESENT 1
#endif #endif
#if (__has_feature(__cxx_generalized_initializers__) && __has_include(< initializer_list>)) #if (__has_feature(__cxx_generalized_initializers__) && __has_include(< initializer_list>))
#define __TBB_INITIALIZER_LISTS_PRESENT 1 #define __TBB_INITIALIZER_LISTS_PRESENT 1
#endif #endif
#define __TBB_CONSTEXPR_PRESENT __has_feature(__cxx_c onstexpr__) #define __TBB_CONSTEXPR_PRESENT __has_feature(__cxx_c onstexpr__)
skipping to change at line 184 skipping to change at line 184
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (__has_feature(__cxx_ range_for__) && _LIBCPP_VERSION) #define __TBB_CPP11_STD_BEGIN_END_PRESENT (__has_feature(__cxx_ range_for__) && _LIBCPP_VERSION)
#define __TBB_CPP11_AUTO_PRESENT __has_feature(__cxx_a uto_type__) #define __TBB_CPP11_AUTO_PRESENT __has_feature(__cxx_a uto_type__)
#define __TBB_CPP11_DECLTYPE_PRESENT __has_feature(__cxx_d ecltype__) #define __TBB_CPP11_DECLTYPE_PRESENT __has_feature(__cxx_d ecltype__)
#elif __GNUC__ #elif __GNUC__
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CX X0X__ #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CX X0X__
#define __TBB_CPP11_RVALUE_REF_PRESENT __GXX_EXPERIMENTAL_CX X0X__ #define __TBB_CPP11_RVALUE_REF_PRESENT __GXX_EXPERIMENTAL_CX X0X__
/** __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 here is a substitution for _GLIB CXX_ATOMIC_BUILTINS_4, which is a prerequisite /** __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 here is a substitution for _GLIB CXX_ATOMIC_BUILTINS_4, which is a prerequisite
for exception_ptr but cannot be used in this file because it is def ined in a header, not by the compiler. for exception_ptr but cannot be used in this file because it is def ined in a header, not by the compiler.
If the compiler has no atomic intrinsics, the C++ library should no t expect those as well. **/ If the compiler has no atomic intrinsics, the C++ library should no t expect those as well. **/
#define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40404 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) #define __TBB_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40404 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40600)
#define __TBB_STATIC_ASSERT_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40300) #define __TBB_STATIC_ASSERT_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40300)
#define __TBB_CPP11_TUPLE_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40300) #define __TBB_CPP11_TUPLE_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40300)
#define __TBB_INITIALIZER_LISTS_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400) #define __TBB_INITIALIZER_LISTS_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400)
/** gcc seems have to support constexpr from 4.4 but tests in (test_ato mic) seeming reasonable fail to compile prior 4.6**/ /** gcc seems have to support constexpr from 4.4 but tests in (test_ato mic) seeming reasonable fail to compile prior 4.6**/
#define __TBB_CONSTEXPR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400) #define __TBB_CONSTEXPR_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400)
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400) #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400)
#define __TBB_NOEXCEPT_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40600) #define __TBB_NOEXCEPT_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40600)
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40600) #define __TBB_CPP11_STD_BEGIN_END_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40600)
#define __TBB_CPP11_AUTO_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400) #define __TBB_CPP11_AUTO_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400)
#define __TBB_CPP11_DECLTYPE_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400) #define __TBB_CPP11_DECLTYPE_PRESENT (__GXX_EXPERIMENTAL_C XX0X__ && __TBB_GCC_VERSION >= 40400)
#elif _MSC_VER #elif _MSC_VER
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (_MSC_VER >= 1800) #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (_MSC_VER >= 1800)
#define __TBB_CPP11_RVALUE_REF_PRESENT (_MSC_VER >= 1600) #define __TBB_CPP11_RVALUE_REF_PRESENT (_MSC_VER >= 1600)
#define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600) #define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600)
#define __TBB_STATIC_ASSERT_PRESENT (_MSC_VER >= 1600) #define __TBB_STATIC_ASSERT_PRESENT (_MSC_VER >= 1600)
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1700)
#define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600) #define __TBB_CPP11_TUPLE_PRESENT (_MSC_VER >= 1600)
#define __TBB_INITIALIZER_LISTS_PRESENT (_MSC_VER >= 1800) #define __TBB_INITIALIZER_LISTS_PRESENT (_MSC_VER >= 1800)
#define __TBB_CONSTEXPR_PRESENT 0 #define __TBB_CONSTEXPR_PRESENT 0
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (_MSC_VER >= 1800) #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT (_MSC_VER >= 1800)
#define __TBB_NOEXCEPT_PRESENT 0 /*for _MSC_VER == 1 800*/ #define __TBB_NOEXCEPT_PRESENT 0 /*for _MSC_VER == 1 800*/
#define __TBB_CPP11_STD_BEGIN_END_PRESENT (_MSC_VER >= 1700) #define __TBB_CPP11_STD_BEGIN_END_PRESENT (_MSC_VER >= 1700)
#define __TBB_CPP11_AUTO_PRESENT (_MSC_VER >= 1600) #define __TBB_CPP11_AUTO_PRESENT (_MSC_VER >= 1600)
#define __TBB_CPP11_DECLTYPE_PRESENT (_MSC_VER >= 1600) #define __TBB_CPP11_DECLTYPE_PRESENT (_MSC_VER >= 1600)
#else #else
#define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0 #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
#define __TBB_CPP11_RVALUE_REF_PRESENT 0 #define __TBB_CPP11_RVALUE_REF_PRESENT 0
#define __TBB_EXCEPTION_PTR_PRESENT 0 #define __TBB_EXCEPTION_PTR_PRESENT 0
#define __TBB_STATIC_ASSERT_PRESENT 0 #define __TBB_STATIC_ASSERT_PRESENT 0
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT 0
#define __TBB_CPP11_TUPLE_PRESENT 0 #define __TBB_CPP11_TUPLE_PRESENT 0
#define __TBB_INITIALIZER_LISTS_PRESENT 0 #define __TBB_INITIALIZER_LISTS_PRESENT 0
#define __TBB_CONSTEXPR_PRESENT 0 #define __TBB_CONSTEXPR_PRESENT 0
#define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT 0 #define __TBB_DEFAULTED_AND_DELETED_FUNC_PRESENT 0
#define __TBB_NOEXCEPT_PRESENT 0 #define __TBB_NOEXCEPT_PRESENT 0
#define __TBB_CPP11_STD_BEGIN_END_PRESENT 0 #define __TBB_CPP11_STD_BEGIN_END_PRESENT 0
#define __TBB_CPP11_AUTO_PRESENT 0 #define __TBB_CPP11_AUTO_PRESENT 0
#define __TBB_CPP11_DECLTYPE_PRESENT 0 #define __TBB_CPP11_DECLTYPE_PRESENT 0
#endif #endif
// C++11 standard library features // C++11 standard library features
#define __TBB_CPP11_TYPE_PROPERTIES_PRESENT (_LIBCPP_VERSION || _MSC_V #define __TBB_CPP11_TYPE_PROPERTIES_PRESENT (_LIBCPP_VERSION || _MS
ER >= 1700) C_VER >= 1700)
#define __TBB_TR1_TYPE_PROPERTIES_IN_STD_PRESENT (__GXX_EXPERIMENTAL_CXX0X_ #define __TBB_TR1_TYPE_PROPERTIES_IN_STD_PRESENT (__GXX_EXPERIMENTAL_CXX
_ && __TBB_GCC_VERSION >= 40300 || _MSC_VER >= 1600) 0X__ && __TBB_GCC_VERSION >= 40300 || _MSC_VER >= 1600)
// GCC has a partial support of type properties
#define __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT (__GXX_EXPERIMENTAL_CXX
0X__ && __TBB_GCC_VERSION >= 40700 || __TBB_CPP11_TYPE_PROPERTIES_PRESENT)
// In GCC and MSVC, implementation of std::move_if_noexcept is not aligned
with noexcept
#define __TBB_MOVE_IF_NOEXCEPT_PRESENT (__GXX_EXPERIMENTAL_CXX0X__
&& __TBB_GCC_VERSION >= 40700 || _MSC_VER >= 1800 || __clang__ && _LIBCPP_
VERSION && __TBB_NOEXCEPT_PRESENT)
//TODO: Probably more accurate way is to analyze version of stdlibc++ via__ GLIBCXX__ instead of __TBB_GCC_VERSION //TODO: Probably more accurate way is to analyze version of stdlibc++ via__ GLIBCXX__ instead of __TBB_GCC_VERSION
#define __TBB_ALLOCATOR_TRAITS_PRESENT (__cplusplus >= 201103L && #define __TBB_ALLOCATOR_TRAITS_PRESENT (__cplusplus >= 201103L
_LIBCPP_VERSION || _MSC_VER >= 1700 || && _LIBCPP_VERSION || _MSC_VER >= 1700 ||
\ \
__GXX_EXPERIMENTAL_CXX0X_ __GXX_EXPERIMENTAL_CXX
_ && __TBB_GCC_VERSION >= 40700 && !(__TBB_GCC_VERSION == 40700 && __TBB_DE 0X__ && __TBB_GCC_VERSION >= 40700 && !(__TBB_GCC_VERSION == 40700 && __TBB
FINE_MIC) \ _DEFINE_MIC) \
) )
#define __TBB_MAKE_EXCEPTION_PTR_PRESENT (__TBB_EXCEPTION_PTR_PRESE
NT && (_MSC_VER >= 1700 || __TBB_GCC_VERSION >= 40600 || _LIBCPP_VERSION))
//TODO: not clear how exactly this macro affects exception_ptr - investigat e //TODO: not clear how exactly this macro affects exception_ptr - investigat e
// On linux ICC fails to find existing std::exception_ptr in libstdc++ with out this define // On linux ICC fails to find existing std::exception_ptr in libstdc++ with out this define
#if __INTEL_COMPILER && __GNUC__ && __TBB_EXCEPTION_PTR_PRESENT && !defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) #if __INTEL_COMPILER && __GNUC__ && __TBB_EXCEPTION_PTR_PRESENT && !defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#endif #endif
// Work around a bug in MinGW32 // Work around a bug in MinGW32
#if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_ BUILTINS_4) #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_ BUILTINS_4)
#define _GLIBCXX_ATOMIC_BUILTINS_4 #define _GLIBCXX_ATOMIC_BUILTINS_4
 End of changes. 8 change blocks. 
16 lines changed or deleted 25 lines changed or added


 tbb_stddef.h   tbb_stddef.h 
skipping to change at line 29 skipping to change at line 29
*/ */
#ifndef __TBB_tbb_stddef_H #ifndef __TBB_tbb_stddef_H
#define __TBB_tbb_stddef_H #define __TBB_tbb_stddef_H
// Marketing-driven product version // Marketing-driven product version
#define TBB_VERSION_MAJOR 4 #define TBB_VERSION_MAJOR 4
#define TBB_VERSION_MINOR 3 #define TBB_VERSION_MINOR 3
// Engineering-focused interface version // Engineering-focused interface version
#define TBB_INTERFACE_VERSION 8001 #define TBB_INTERFACE_VERSION 8002
#define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000
// The oldest major interface version still supported // The oldest major interface version still supported
// To be used in SONAME, manifests, etc. // To be used in SONAME, manifests, etc.
#define TBB_COMPATIBLE_INTERFACE_VERSION 2 #define TBB_COMPATIBLE_INTERFACE_VERSION 2
#define __TBB_STRING_AUX(x) #x #define __TBB_STRING_AUX(x) #x
#define __TBB_STRING(x) __TBB_STRING_AUX(x) #define __TBB_STRING(x) __TBB_STRING_AUX(x)
// We do not need defines below for resource processing on windows // We do not need defines below for resource processing on windows
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/