Commit graph

18 commits

Author SHA1 Message Date
Nekotekina a4fdbf0a88 Enable -Wstrict-aliasing=1 (GCC)
Fixed partially.
2021-03-09 03:10:15 +03:00
Nekotekina bbf52f3cea named_thread: fix bugs in std::forward usage
Fix few misused threads and other bugs.
2021-03-02 16:08:14 +03:00
Nekotekina aa7e2376ec shared_ptr.hpp: minor fixup for arrays 2021-03-02 16:08:14 +03:00
Nekotekina 71e16bfac3 shared_ptr.hpp: minor fixup 2021-03-01 00:28:28 +03:00
Nekotekina de9d859f4a named_thread: implement task queue
atomic_ptr: implement push_head()

thread_ctrl::state() triggers task queue execution.
2021-02-28 20:20:17 +03:00
Nekotekina 038148bf06 Fix almost all GCC warnings 2021-02-17 22:59:04 +03:00
JohnHolmesII 02b684b810 Warnings: Warnings use kebab case, Mr. Kot 2020-12-29 14:17:34 +03:00
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