File tree Expand file tree Collapse file tree 5 files changed +15
-10
lines changed
Expand file tree Collapse file tree 5 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ namespace Death {
357357 DEATH_ALWAYS_INLINE std::shared_ptr<T> runtime_cast (std::shared_ptr<U>&& u) noexcept {
358358 auto ptr = Death::TypeInfo::Implementation::Helpers::RuntimeCast<T>(u.get (), std::is_base_of<T, U>());
359359 if (ptr) {
360- return std::shared_ptr<T>(std ::move (u), ptr);
360+ return std::shared_ptr<T>(Death ::move (u), ptr);
361361 }
362362 return {};
363363 }
@@ -410,7 +410,7 @@ namespace Death {
410410 DEATH_ALWAYS_INLINE std::shared_ptr<T> runtime_cast (std::shared_ptr<U>&& u) noexcept {
411411 auto ptr = dynamic_cast <T*>(u.get ());
412412 if (ptr) {
413- return std::shared_ptr<T>(std ::move (u), ptr);
413+ return std::shared_ptr<T>(Death ::move (u), ptr);
414414 }
415415 return {};
416416 }
Original file line number Diff line number Diff line change 77#include " Tags.h"
88#include " ../Asserts.h"
99
10+ #include < algorithm>
11+ #include < cstring>
1012#include < initializer_list>
1113#include < limits>
12- #include < cstring>
1314#include < memory>
1415#include < type_traits>
15- #include < algorithm>
1616
1717namespace Death { namespace Containers {
1818// ###==##====#=====--==~--~=~- --- -- - - - -
Original file line number Diff line number Diff line change @@ -642,7 +642,7 @@ namespace Death { namespace Trace {
642642
643643 void LoggerBackend::DispatchTransitEventToSinks (TransitEvent const & transitEvent, StringView threadId) noexcept
644644 {
645- StringView functionNameView{transitEvent.FunctionName };
645+ StringView functionNameView{transitEvent.FunctionName , StringViewFlags::Global };
646646 StringView contentView{transitEvent.Message };
647647
648648 for (std::size_t i = 0 ; i < _sinks.size (); i++) {
@@ -807,7 +807,7 @@ namespace Death { namespace Trace {
807807 }
808808 }
809809
810- StringView functionNameView{static_cast <const char *>(functionName)};
810+ StringView functionNameView{static_cast <const char *>(functionName), StringViewFlags::Global };
811811 StringView contentView{static_cast <const char *>(content), std::size_t (contentLength)};
812812
813813 for (std::size_t i = 0 ; i < _sinks.size (); i++) {
Original file line number Diff line number Diff line change 3030#elif defined(__DragonFly__)
3131# include < sys/lwp.h>
3232# include < unistd.h>
33+ #elif defined(__OpenBSD__)
34+ # include < pthread_np.h>
35+ # include < unistd.h>
3336#elif !defined(DEATH_TARGET_WINDOWS)
3437# include < pthread.h>
3538# include < unistd.h>
@@ -102,6 +105,8 @@ namespace Death { namespace Trace {
102105 return static_cast <std::uint32_t >(lwpid);
103106# elif defined(__DragonFly__)
104107 return static_cast <std::uint32_t >(lwp_gettid ());
108+ # elif defined(__OpenBSD__)
109+ return static_cast <std::uint32_t >(getthrid ());
105110# else
106111 return reinterpret_cast <std::uintptr_t >(pthread_self ());
107112# endif
Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ namespace Death { namespace Threading {
1919 void lock () noexcept
2020 {
2121 do {
22- while (_flag .load (std::memory_order_relaxed) == State::Locked) {
22+ while (_state .load (std::memory_order_relaxed) == State::Locked) {
2323 // Keep trying...
2424 }
25- } while (_flag .exchange (State::Locked, std::memory_order_acquire) == State::Locked);
25+ } while (_state .exchange (State::Locked, std::memory_order_acquire) == State::Locked);
2626 }
2727
2828 void unlock () noexcept
2929 {
30- _flag .store (State::Free, std::memory_order_release);
30+ _state .store (State::Free, std::memory_order_release);
3131 }
3232
3333 private:
@@ -36,7 +36,7 @@ namespace Death { namespace Threading {
3636 Locked = 1
3737 };
3838
39- std::atomic<State> _flag {State::Free};
39+ std::atomic<State> _state {State::Free};
4040 };
4141
4242}}
You can’t perform that action at this time.
0 commit comments