mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Perform Vector's swap() as a bitwise move.
This commit is contained in:
parent
b6213cfbc5
commit
a1488a74a1
@ -71,9 +71,10 @@ public:
|
||||
|
||||
tracy_force_inline void swap( Vector& other )
|
||||
{
|
||||
std::swap( m_ptr, other.m_ptr );
|
||||
std::swap( m_size, other.m_size );
|
||||
std::swap( m_capacity, other.m_capacity );
|
||||
uint8_t tmp[sizeof( Vector<T> )];
|
||||
memcpy( tmp, &other, sizeof( Vector<T> ) );
|
||||
memcpy( &other, this, sizeof( Vector<T> ) );
|
||||
memcpy( this, tmp, sizeof( Vector<T> ) );
|
||||
}
|
||||
|
||||
tracy_force_inline bool empty() const { return m_size == 0; }
|
||||
|
Loading…
Reference in New Issue
Block a user