New
3.27.00
Changes
- Fixed false positives for TSAN in
shared_ptr's ref counting when releasing the last count. - Add
eastl::atomic_raw_Xwhich provides an API similar to that ofeastl::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 toeastl::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. Seeatomic_raw.hfor details. - Improvements to atomic pointer loads with
memory_order_read_depends:- Implement it in terms of the
relaxedloads by default so TSAN understands the load as an atomic load. This can be changed to useacquiresemantics instead with a config property. - Instrument it as a
__tsan_memory_order_consumeload so TSAN doesn't flag address dependent loads as errors, that's the intention for theread_dependsmemory order.
- Implement it in terms of the
- Add
atomic<T>::acquire_fencefor integralT, 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
hashtableandintrusive_hashtablesobegin()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_elementfor 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_functionwould 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
expectedandoptional. - Allow for
vectorto have more than0x80000000elements without asserting. - Add asserts to
vectorto verify we don't overflowsize_typewhen inserting elements into it. - Add support for bitflags and maskflags (see the new
bonus/flags.hheader). - Tweak
fixed_vectorimplementation to reset capacity to starting value when using aresize()function that provokes a move back to the initially buffered range. - Add some new
fixed_vectorconstructors 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()andall()member functions tobitvector. - Deprecate
array<T, N>having a default ofN = 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;
- Note, in implementing this functionality the type trait
- 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_vectorandlistincorrectly default initializing their elements. New behaviour is to value initialize them. - Deprecate
find_as()with default hash and equality objects forhash_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, and . Relax the requirement to C++17 for safe integer comparison functions.