mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-31 12:31:45 +01:00
Util/fixed_typemap.hpp: set unitialiazed data to trap values
This commit is contained in:
parent
0c410f8a14
commit
2190419b83
@ -44,6 +44,7 @@ namespace stx
|
||||
static void call_dtor(void* ptr) noexcept
|
||||
{
|
||||
std::launder(static_cast<T*>(ptr))->~T();
|
||||
std::memset(ptr, 0xCC, sizeof(T)); // Set to trap values
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -93,9 +94,11 @@ namespace stx
|
||||
{
|
||||
ensure(Size >= stx::typelist<typeinfo>().size());
|
||||
ensure(Align >= stx::typelist<typeinfo>().align());
|
||||
m_data[0] = 0;
|
||||
}
|
||||
|
||||
// Set to trap values
|
||||
std::memset(Size == 0 ? m_list : m_data, 0xCC, stx::typelist<typeinfo>().size());
|
||||
|
||||
for (const auto& type : stx::typelist<typeinfo>())
|
||||
{
|
||||
const u32 id = type.index();
|
||||
|
@ -122,6 +122,7 @@ namespace stx
|
||||
static void call_dtor(void* ptr) noexcept
|
||||
{
|
||||
std::launder(static_cast<T*>(ptr))->~T();
|
||||
std::memset(ptr, 0xCC, sizeof(T)); // Set to trap values
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -219,9 +220,11 @@ namespace stx
|
||||
{
|
||||
ensure(Size >= stx::typelist<typeinfo>().size());
|
||||
ensure(Align >= stx::typelist<typeinfo>().align());
|
||||
m_data[0] = 0;
|
||||
}
|
||||
|
||||
// Set to trap values
|
||||
std::memset(Size == 0 ? m_list : m_data, 0xCC, stx::typelist<typeinfo>().size());
|
||||
|
||||
*m_order++ = nullptr;
|
||||
*m_info++ = nullptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user