Commit graph

11 commits

Author SHA1 Message Date
Nekotekina 5f618814f6 atomic.hpp: use u128 as storage for masks/values 2020-12-21 13:51:23 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina ca5f0444bf shared_ptr.hpp: add wait support for atomic_ptr<>
As well as default mask and value transformation function overload.
2020-12-15 12:52:21 +03:00
Nekotekina 09d293592e shared_ptr.hpp: fix is_same_ptr<>() trait
Implemented as constexpr function.
2020-12-13 15:39:36 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
Nekotekina 77aa9e58f2 shared_ptr.hpp: add trivial conversion for shared/single types
These conversions don't exist in std::shared_ptr-alike types.
But I don't want to bother with == operators until we have proper C++20.
Removed trivial conversion for atomic_ptr because it's heavyweight.
2020-12-07 15:33:28 +03:00
Nekotekina 983439076b shared_ptr.hpp: fixups and updates
Fix atomic_ptr load() edge case.
Implement atomic_ptr::peek_op() to make possible to reduce load() overhead.
Implement atomic_ptr::compare_exchange() and friends.
Implement null_ptr constant, remove nullptr_t assignment/construction.
2020-12-04 14:10:53 +03:00
Nekotekina 332410d20b shared_ptr.hpp: improve atomic_ptr methods 2020-12-04 14:10:53 +03:00
Nekotekina 3b8e3a9714 stdafx.h: remove BOM from custom included headers
Also add warnings about adding them.
2020-11-29 15:35:05 +03:00
Nekotekina 872655369a shared_ptr.hpp: fix critical bugs
Fix array initialization.
Fix reference counting.
Fix offset to refctr.
Add some features.
2020-11-27 14:32:41 +03:00
Nekotekina b5d498ffda Homebrew atomic_ptr rewritten (util/shared_ptr.hpp)
It's analogous to C++20 atomic std::shared_ptr

The following things brought into global namespace:
single_ptr
shared_ptr
atomic_ptr
make_single
2020-11-26 20:11:26 +03:00