mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Remove the alignment tests
* Don't fail the sanitizers when testing with coroutines
This commit is contained in:
parent
c2ad28d702
commit
7aae524cb1
@ -43,13 +43,6 @@
|
|||||||
|
|
||||||
namespace cti {
|
namespace cti {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
#ifndef _NDEBUG
|
|
||||||
template <typename T>
|
|
||||||
bool is_aligned(T const* p) {
|
|
||||||
return !(reinterpret_cast<uintptr_t>(p) % std::alignment_of<T>::value);
|
|
||||||
}
|
|
||||||
#endif // _NDEBUG
|
|
||||||
|
|
||||||
namespace util {
|
namespace util {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
enum class slot_t { empty, value, error };
|
enum class slot_t { empty, value, error };
|
||||||
@ -306,36 +299,12 @@ private:
|
|||||||
template <typename V>
|
template <typename V>
|
||||||
V& cast() noexcept {
|
V& cast() noexcept {
|
||||||
assert(!is_empty());
|
assert(!is_empty());
|
||||||
|
return *reinterpret_cast<V*>(&this->storage_);
|
||||||
#ifndef _NDEBUG
|
|
||||||
{
|
|
||||||
void* ptr = &this->storage_;
|
|
||||||
auto space = sizeof(this->storage_);
|
|
||||||
void* aligned = std::align(alignof(V), sizeof(V), ptr, space);
|
|
||||||
assert(aligned && "Bad alignment!");
|
|
||||||
}
|
|
||||||
#endif // _NDEBUG
|
|
||||||
|
|
||||||
auto ptr = reinterpret_cast<V*>(&this->storage_);
|
|
||||||
assert(is_aligned(ptr) && "ptr not aligned!");
|
|
||||||
return *ptr;
|
|
||||||
}
|
}
|
||||||
template <typename V>
|
template <typename V>
|
||||||
V const& cast() const noexcept {
|
V const& cast() const noexcept {
|
||||||
assert(!is_empty());
|
assert(!is_empty());
|
||||||
|
return *reinterpret_cast<V const*>(&this->storage_);
|
||||||
#ifndef _NDEBUG
|
|
||||||
{
|
|
||||||
void* ptr = const_cast<void*>(static_cast<void const*>(&this->storage_));
|
|
||||||
auto space = sizeof(this->storage_);
|
|
||||||
void* aligned = std::align(alignof(V), sizeof(V), ptr, space);
|
|
||||||
assert(aligned && "Bad alignment!");
|
|
||||||
}
|
|
||||||
#endif // _NDEBUG
|
|
||||||
|
|
||||||
auto ptr = reinterpret_cast<V const*>(&this->storage_);
|
|
||||||
assert(is_aligned(ptr) && "ptr not aligned!");
|
|
||||||
return *ptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename V>
|
template <typename V>
|
||||||
|
|||||||
@ -47,9 +47,17 @@ function renew_build {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [[ $CXX == *"clang"* ]]; then
|
if [[ $CXX == *"clang"* ]]; then
|
||||||
LSAN_OPTIONS=verbosity=1:log_threads=1:abort_on_error=1
|
if [ $WITH_AWAIT != "ON" ]; then
|
||||||
ASAN_OPTIONS=verbosity=1:log_threads=1:abort_on_error=1
|
# Abort when the sanitizers detect an error
|
||||||
UBSAN_OPTIONS=print_stacktrace=1:symbolize=1:halt_on_error=1:print_summary=1
|
LSAN_OPTIONS=verbosity=1:log_threads=1:abort_on_error=1
|
||||||
|
ASAN_OPTIONS=verbosity=1:log_threads=1:abort_on_error=1
|
||||||
|
UBSAN_OPTIONS=print_stacktrace=1:symbolize=1:halt_on_error=1:print_summary=1
|
||||||
|
else
|
||||||
|
# Continue when the sanitizers detect an error (when using await)
|
||||||
|
LSAN_OPTIONS=verbosity=1:log_threads=1
|
||||||
|
ASAN_OPTIONS=verbosity=1:log_threads=1
|
||||||
|
UBSAN_OPTIONS=print_stacktrace=1:symbolize=1:print_summary=1
|
||||||
|
fi
|
||||||
|
|
||||||
# Build the test suite with various sanitizers:
|
# Build the test suite with various sanitizers:
|
||||||
if [ $WITH_AWAIT != "ON" ]; then
|
if [ $WITH_AWAIT != "ON" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user