Skip to content

3.21.12

Compare
Choose a tag to compare
@jhopkins-ea jhopkins-ea released this 09 Jun 07:30
· 14 commits to master since this release
e757b44

This version of EASTL contains a number of improvements, including many bug fixes found through the use of undefined behaviour sanitizer (UBSan), as well as a swathe of deprecations.

Changes:

  • Add return type / value for some deque::insert() overloads that were missing a return.
  • Make deque::insert(position, first, last) compilable for input (single pass) iterators.
  • Fix issues compiling when EASTL_SIZE_T_32BIT is set to 1.
  • Add a const to an operator to comply with P2468R2.
  • Remove explicit copy constructor/assignment from eastl::bitvector so we don't inhibit move constructor/assignment.
  • Added a test to see that we can now move eastl::bitvector.
  • Remove various unused variables from variant to remove warnings.
  • Add vector_map<Key, T>::at_key() overloads as the inherited vector<pair<const Key, T>>::at() function doesn't have the correct semantics and returns the incorrect type (pair<const Key, T>& rather than T).
  • Add hash_map natvis for key/value visualization.
  • Add is_partitioned and partition_point to algorithms.h.
  • Ensure n > 0 before calling memcmp() in char_trait's Compare() and lexicographical_compare() to avoid undefined behaviour.
  • Ensure n > 0 before calling memmove() in copy_backward() or move_backward() to avoid undefined behaviour.
  • Ensure first != last before calling memcpy() in uninitialized_relocate_start() (which is deprecated) to avoid undefined behaviour.
  • Make tuple default constructible when an element type has no member types (which tuple has an empty base optimization for).
  • Ensure n > 0 before calling memmove() in basic_string::assign(); flagged by UBSan.
  • Remove user provided implementation of copy/move assignment operators for eastl::pair so it can be trivially copied if the template parameters are trivially copyable.
  • Added printf format specifiers for use with eastl_size_t that work with both 32- and 64-bit sizes.
  • UBSAN fixes. Remove some unecessary invalid casting in rb_tree.
  • Change some tests to avoid doing nullptr arithmetic, which is undefined behaviour.
  • Change random_shuffle so it doesn't overrun the iterator when first == last.
  • Change tim_sort_buffer so it doesn't invoke undefined behaviour when called on empty vectors.
  • Change radix_sort_impl so it doesn't over-right-shifts on it's last loop when trying to write to the histogram.
  • Change shell_sort so it doesn't overrun the iterator in the loop increment expression.
  • Use aligned allocations in EASTLTestAllocator to avoid allocating missaligned memory on platfroms require larger alignment restrictions for operator new.
  • Make list_map_iterator::mpNode private and change its type to avoid various insances of undefined behaviour when downcasting the anchor node, which is has type list_map_data_base but isn't a list_map_data<T>. No replacement accessor has been provided as mpNode is an internal impelmentation detail that isn't useful for users.
  • Make rbtree_iterator::mpNode private and change its type to avoid various insances of undefined behaviour when downcasting the anchor node, which is has type rbtree_node_base but isn't a rbtree_node<T>. No replacement accessor has been provided as mpNode is an internal impelmentation detail that isn't useful for users.
  • Add natvis support for atomic<T>.
  • Make intrusive_list_iterator::mpNode private and change its type to avoid various insances of undefined behaviour when downcasting the anchor node, which is has type intrusive_list_node but isn't a T. A helper function nodePtr() has been provided, which is equivalent to accessing the old member directly.
  • Update is_pod's implementation on clang-cl to no longer use the compiler builtin __has_trivial_constructor that is deprecated in latest version of clang.
  • Change the type of ListIterator<T>::mpNode from ListNode<T>* to ListNodeBase* to avoid various instances of undefined behaviour when downcasting the anchor node which is a ListNodeBase but not a ListNode<T>.
  • Change the type of SListIterator<T>::mpNode from SListNode<T>* to SListNodeBase* to avoid various instances of undefined behaviour when downcasting the anchor node which is an SListNodeBase but not a SListNode<T>.
  • Remove EASTL_LIST_PROXY_ENABLED, there's no configuration in which it is enabled and enabling it explicitly causes compile errors that we're not interested in fixing.
  • extract_signature_from_callable compiler fix for C++14.
  • Remove uses of compiler builtins that are deprecated in latest version of clang.
  • Added hash function to eastl::fixed_string
  • fix compile error for uninitialized_copy for trivially copyable types that are not assignable.
  • Removed unqualified name lookup for invoke in apply to prevent any ambiguity with other invoke functions.
  • Fixed warning about uninitialised base class in estl::optional copy constructor
  • Added deduction guides for function.
  • Re-add string_view symmetric comparisons (relational operators).
  • Fix "#pragma warning(pop): likely mismatch, popping warning state pushed in different file" warning generated by atomic_push_compiler_optins.h header.
  • Reduce vector_set, vector_multiset, vector_map and vector_multimap's size when the Compare template parameter is an empty class.
  • Fix tuple_cat for calls with l-values and for calls with less than two arguments.
  • Remove non-standard array<T, N> behaviour: array<T, 0> no longer has size() == 1. Deprecate count enumerator.
  • rotate(), uninitialized_copy() + deque optimizations: apply memmove/memcopy optimizations using the correct type trait, is_trivially_copyable<T>.
  • Add structured binding support for array<T, N>.
  • Disable EXPECT_ASSERT for windows-clang when exceptions are disabled to fix compile break.

Deprecations:
The following deprecations will be removed approximately April 2024.

  • Aligning with the standard:
    • EASTL_DECLARE macros - assert that the type trait is true instead of overriding EASTL's definition.
      Note: compile warnings / errors generated will be on the usage of the type declared to have the trait.
      The correct fix is to remove the EASTL_DECLARE usage, not the usage of the type itself.
    • add_(un)signed - use make_(un)signed instead.
    • identity - use type_identity(_t) instead.
    • equal_to_2, not_equal_to_2, less_2 - instead use equal_to<>, not_equal_to<> and less<> respectively.
    • unary_compose, binary_compose - use a lambda instead.
    • add_reference - use add_lvalue_reference(_t) instead.
    • is_array_of_(un)known_bounds - use is_(un)bounded_array.
    • type_select - use conditional.
    • type_and, type_or, type_equal, type_not_equal, type_not - use bool_constant<(expression)> instead.
    • identity - use type_identity instead.
    • has_trivial_constructor - use is_trivially_default_constructible instead.
    • has_trivial_copy - use is_trivially_copy_constructible instead.
    • has_trivial_assign - use is_trivially_assignable, is_trivially_move_assignable or is_trivially_copy_assignable instead.
    • has_trivial_destructor - use is_trivially_destructible instead.
    • has_trivial_relocate - use is_trivially_copyable instead.
    • has_nothrow_constructor - use is_nothrow_constructible instead.
    • has_nothrow_copy - use is_nothrow_copy_constructible instead.
    • has_nothrow_assign - use is_nothrow_assignable instead.
    • uninitialized_relocate_start, uninitialized_relocate_commit, uninitialized_relocate_abort, uninitialized_relocate - pre-C++11 functions that are replaced by move semantics.
    • Deprecate uninitialized_default_fill(_n) - use uninitialized_value_construct instead.
    • Deprecate const and volatile element types for vector, fixed_vector and deque.
  • Improvements to the standard:
    • is_literal_type - use constexpr if to determine whether an expression is constant evaluated.
    • iterator - define typedefs without the use of inheritence.
    • result_of - use invoke_result instead.
    • get_temporary_buffer - unused part of the standard (citation).
    • unary_function, binary_function - no need to inherit from these types.
    • unary_negate, binary_negate - no need to inherit from these types: use not_fn or lambdas instead if necessary.
    • pointer_to_unary_function, pointer_to_binary_function - use mem_fn or a lambda instead.
    • mem_fun, mem_fun_ref - use mem_fn, mem_fn(ref()) or a lambda.
    • bind1st, bind2nd - use a lambda instead.
  • Miscellaneous:
    • hashtable::equal_function() - use key_eq() instead.
    • hashtable::kAllocFlagBuckets - use kHashtableAllocFlagBuckets instead.
    • hashtable comparison operator (non equality) - shouldn't be comparing hashtables.
    • queue::emplace_back - use emplace instead.
    • safe_ptr::has_references - use has_unique_references instead.
    • slist::splice_after - use one of the other splice or splice_after overloads.
    • Deprecate is_lvalue_assignable. Its usage seems limited, and is_copy_assignable is probably the correct trait to use.