mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx++: workaround for compile-time 'uninitialized' warning (i.e. a GCC's bug) from GCC 10.x with enabled UB-sanitizer.
This commit is contained in:
parent
ffb8d23632
commit
15ed0f6a84
3
mdbx.h++
3
mdbx.h++
@ -1172,6 +1172,9 @@ private:
|
|||||||
/* properly destroy allocator::pointer */
|
/* properly destroy allocator::pointer */
|
||||||
allocated_.~allocated();
|
allocated_.~allocated();
|
||||||
}
|
}
|
||||||
|
if (::std::is_trivial<allocator_pointer>::value)
|
||||||
|
/* workaround for "uninitialized" warning from some compilers */
|
||||||
|
::std::memset(&allocated_.ptr_, 0, sizeof(allocated_.ptr_));
|
||||||
lastbyte() = inplace_lastbyte_mask();
|
lastbyte() = inplace_lastbyte_mask();
|
||||||
MDBX_CONSTEXPR_ASSERT(is_inplace() && address() == inplace_ &&
|
MDBX_CONSTEXPR_ASSERT(is_inplace() && address() == inplace_ &&
|
||||||
is_suitable_for_inplace(capacity()));
|
is_suitable_for_inplace(capacity()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user