mirror of
https://github.com/boostorg/stacktrace.git
synced 2026-02-22 03:32:27 +00:00
Fix minor issues that are seen by tests and appeared after refactoring
This commit is contained in:
@@ -86,6 +86,7 @@ public:
|
||||
BOOST_STACKTRACE_FUNCTION bool operator==(const backend& rhs) const BOOST_NOEXCEPT;
|
||||
|
||||
BOOST_STACKTRACE_FUNCTION backend(const backend& b, void* memory) BOOST_NOEXCEPT;
|
||||
BOOST_STACKTRACE_FUNCTION backend& operator=(const backend& b) BOOST_NOEXCEPT;
|
||||
BOOST_STACKTRACE_FUNCTION ~backend() BOOST_NOEXCEPT;
|
||||
BOOST_STACKTRACE_FUNCTION std::size_t size() const BOOST_NOEXCEPT;
|
||||
};
|
||||
|
||||
@@ -22,6 +22,19 @@ backend::backend(const backend& b, void* memory) BOOST_NOEXCEPT
|
||||
);
|
||||
}
|
||||
|
||||
backend& backend::operator=(const backend& b) BOOST_NOEXCEPT {
|
||||
if (data_ == b.data_) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
reinterpret_cast<backtrace_holder*>(data_)->~backtrace_holder();
|
||||
new(data_) backtrace_holder(
|
||||
b.impl()
|
||||
);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
backend::~backend() BOOST_NOEXCEPT {
|
||||
reinterpret_cast<backtrace_holder*>(data_)->~backtrace_holder();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ backend::backend(const backend& b, void* memory) BOOST_NOEXCEPT
|
||||
: data_(memory)
|
||||
{}
|
||||
|
||||
backend& backend::operator=(const backend& b) BOOST_NOEXCEPT {
|
||||
return *this;
|
||||
}
|
||||
|
||||
backend::~backend() BOOST_NOEXCEPT {}
|
||||
|
||||
std::size_t backend::size() const BOOST_NOEXCEPT {
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/// @brief Stores the current function call sequence inside the class.
|
||||
///
|
||||
/// @b Complexity: O(N) where N is call seaquence length, O(1) for noop backend.
|
||||
stacktrace() BOOST_NOEXCEPT
|
||||
BOOST_FORCEINLINE stacktrace() BOOST_NOEXCEPT
|
||||
: impl_()
|
||||
, hash_code_()
|
||||
, back_(&impl_, sizeof(impl_), hash_code_)
|
||||
@@ -60,9 +60,8 @@ public:
|
||||
|
||||
/// @b Complexity: O(1)
|
||||
stacktrace& operator=(const stacktrace& st) BOOST_NOEXCEPT {
|
||||
back_.~backend();
|
||||
hash_code_ = st.hash_code_;
|
||||
new (&back_) boost::stacktrace::detail::backend(st.back_, &impl_);
|
||||
back_ = back_;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user