Skip to content

Conversation

@grojo-ea
Copy link
Contributor

@grojo-ea grojo-ea commented Aug 1, 2025

Changes in the 3.27.00 ... 3.21.23 window

  • Fixed false positives for TSAN in shared_ptr's ref counting when releasing the last count.
  • Add eastl::atomic_raw_X which provides an API similar to that of eastl::atomic<T> but which can operate on non-atomic variables. This can be used as a last resort in situations where we're interested in specifying memory order semantics but cannot change the type of the variable to eastl::atomic<T> (for example due to having to cross established API boundaries which can't change). We have only added support to operate on integral and pointer types. See atomic_raw.h for details.
  • Improvements to atomic pointer loads with memory_order_read_depends:
    • Implement it in terms of the relaxed loads by default so TSAN understands the load as an atomic load. This can be changed to use acquire semantics instead with a config property.
    • Instrument it as a __tsan_memory_order_consume load so TSAN doesn't flag address dependent loads as errors, that's the intention for the read_depends memory order.
  • Remove an unnecessary branch on MSVC's implementation of the atomic compare_exchange functions.
  • Add atomic<T>::acquire_fence for integral T, which is intended for optimal synchronization when doing reference counting through the atomic.
  • Improve default hash function implementation for floating-point types to avoid frequent collisions
  • Fix hashtable and intrusive_hashtable so begin() will early out when they are empty instead of iterating through the entire bucket array.
  • Fix compilation errors in get<I>() for tuples with an empty tuple member.
  • Deprecate tuple_element for volatile types to match the standard.
  • Fix vector::push_back() inserting the wrong value with an element from the vector. The vector now constructs the new element before moving the internal array when growing the vector.
  • Fix Issue where fixed_function would allocate when another fixed function with a smaller buffer was assigned to it. I.e. the following would lead to allocations
   eastl::fixed_function<8, void(void)> f1;
   eastl::fixed_function<16, void(void)> f2;
   f2 = f1
  • Add new compile assert when attempting to store functor with too large of alignment into fixed_function (this previously incorrectly triggered an allocation instead of asserting)
  • Fix TSAN issues related to concurrently writing to the global empty bucket array in our hashtable implementation.
  • Added hardened library asserts for expected and optional.
  • Allow for vector to have more than 0x80000000 elements without asserting.
  • Add asserts to vector to verify we don't overflow size_type when inserting elements into it.
  • Add support for bitflags and maskflags (see the new bonus/flags.h header).
  • Tweak fixed_vector implementation to reset capacity to starting value when using a resize() function that provokes a move back to the initially buffered range.
  • Add some new fixed_vector constructors to match vector.
  • Tweak bitvector "this_type" to properly specify container to prevent invalid template matches (eg swap functions that match bitvectors with different container types).
  • Add any() and all() member functions to bitvector.
  • Deprecate array<T, N> having a default of N = 1. This makes array conformant to the standard and reduces potential confusion with deduction guides, such as:
   eastl::array a{1, 2, 3}; // omit template parameters from the type declaration, parameters deduced using type deduction guide.
   eastl::array<int> a{1, 2, 3}; // error: won't deduce N. Defaults to N=1.
  • Add make_from_tuple<T>(tuple<Ts...>)
  • Allocators may now have an optional construct(), with the same semantics as the standard's Allocator construct function. EASTL now uses this wherever an allocator may be used to construct an object of the allocator's type (ie. containers, shared_ptr, shared_array and fixed_swap).
    • Note, in implementing this functionality the type trait is_default_constructible_v<T> may now be invoked on more types. This may cause compilations failures due to a C++ language defect. The language defect is that type traits may fail because it's unclear whether a nested type should be treated as a complete type in some contexts. In particular, a nested type with non-static data member initialization causes eastl::is_default_constructible_v<> to evaluate to false on Clang & GCC. For more details see llvm bug report and the defect tracked by the C++ standards committee.
      As a workaround to the language defect, declare a default constructor explicitly, eg. MyType() noexcept = default;
  • Fixed containers no longer overwrite the allocator name when an overflow allocator is specified.
  • Added static asserts that containers don't have const elements. This isn't supported.
  • Deprecate fixed_vector and list incorrectly default initializing their elements. New behaviour is to value initialize them.
  • Deprecate find_as() with default hash and equality objects for hash_set, hash_multiset, fixed_hash_set, fixed_hash_multiset, intrusive_hash_set, intrusive_hash_multiset. Use heterogeneous comparison lookup instead. See the FAQ and Best Practices pages for explanation of these new overloads.
  • Remove the C++20 requirement for bit manipulation functions, isnan() and lerp(). Relax the requirement to C++17 for safe integer comparison functions.
  • Fix implementation of countl_zero() for unsigned 128 bit types.
  • Fix bitset<eastl_uint128_t>::count() implementation.
  • bit_width now has a return type of int, which matches the standard.
  • Alias iterator tags to the standard when EASTL_STD_ITERATOR_CATEGORY_ENABLED and replace usages of EASTL_ITC_NS with eastl, as it's no longer required.
  • Add SetAssertionFailureFunction that uses instruction pointer for assertion callback to handle exact location of assertion.
  • Add constexpr specifier to eastl::late_constructed's ctor so that dynamic initializers don't get generated for global instances when optimization is disabled (e.g. for debug builds).
  • Explicitly crash when invoking the call operator on an empty eastl::function instead of potentially letting it fall through and return garbage.
  • Fix natvis implementation for eastl::span which broke on version 3.21.20.
  • Improvements to variant<Ts...>
    • get<T>(variant<Ts...>) and get<size_t>(variant<Ts...>) will now assert / throw if the variant doesn't hold the requested alternative type.
    • Only enable visit(Visitor&&, Variants&&) / visit<Result>(Visitor&&, Variants&&) overloads per the standard, ie. the visitor has to be callable with the variants' alternative types for the visit overload to be enabled.
    • Reduce the size of variant<Ts...>; internally it no longer uses a pointer for dispatch to the alternative type.
    • Special member functions are now only enabled if all the alternative types support the operation.
    • Only enable trivial special member functions (copy and move constructor and assignment) if all the alternative types' equivalent function is trivial. The original logic checks whether the alternative types are trivially destructible, which would incorrectly enable trivial special member functions.
    • converting assignment (variant<Ts...>::operator=<T>(T&&)) now calls the assignment operator if the variant already holds the alternative type that is being assigned (per the standard).
    • removed the unnecessary check from emplace<I>(...) that the alternative type for I must be unique.
    • swap(variant<Ts...>&, variant<Ts...>&) is now implemented in terms of swap() and move construction rather than just move construction (per the standard).
    • Implement hash<variant<Ts...>>, including disabling the hash when the alternative types do not have a hash specialization.
  • Add in_place_type<T> and in_place_index<size_t>. Remove in_place<T>, in_place<size_t>.
  • Make many scoped_ptr<T>'s operations noexcept.
  • Fix EASTL_THROW_OR_ASSERT so it is defined after EASTL_EXCEPTIONS_ENABLED.
  • Improvements to optional<T>
    • Special member functions are now only enabled if the contained type T supports the operation.
    • Remove optional<T>(const T&), optional<T>(T&&) constructors (not a part of the standard).
    • Fix optional<T>(in_place_t, T, Args...) constructor so that it doesn't use list initialization.
    • Add converting copy and move constructors.
    • Conditionally make constructors implicit if the contained type is implicitly convertible.
  • Fix is_nothrow_constructible to use intrinsic if available.
  • Fix ring_buffer comparison functions (operator < and operator==).
  • Fix eastl::biset so it compiles with C++14.
  • Remove unnecessary std:: causing issues when compiling with C++14.
  • Add eastl::includes to algorithm.h. This function evaluates if an ordered range is a subsequence of another (docs).
  • Add expected (P0323). This is available in EASTL if C++17 or later is enabled.
  • Add transparent_string_hash, for use in hash_map.
  • Extend hash<T> specializations for strings with any allocator.
  • Fix deque::set_allocator() assertion so that it will assert when non-empty.
  • Add assertions to set_allocator() for vector, string, shared_array, map, set, hash_map, hash_set, tuple_vector. This validates that an allocation hasn't already been made when changing the allocator, otherwise memory will be leaked / deallocated from the incorrect allocator.
  • Add support for C++14's heterogeneous comparison lookup (N3657), C++23's heterogeneous erasure (P2077R3) and C++26's heterogeneous insertion (P2363R5) functions for set, multiset, hash_set, hash_multiset, fixed_set, fixed_multiset, fixed_hash_set, fixed_hash_multiset, vector_set, vector_multiset, vector_map & vector_multimap. See the FAQ and Best Practices pages for explanation of these new overloads.
  • Mark eastl::finally as nodiscard.
  • Fix pair constructor and assignment so that it's enabled for types that are constructible to and assignable to, respectively, the member types rather than convertible to.
  • Fix remove and remove_copy to comply with std implementation, such that they reorder elements using move and copy assignment respectively.
  • Remove return_temporary_buffer() and apply_cv<T, U, bool, bool>.
  • Remove previously deprecated code.

@grojo-ea grojo-ea merged commit 0b8a259 into master Aug 3, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants