mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04: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 )
|
tracy_force_inline void swap( Vector& other )
|
||||||
{
|
{
|
||||||
std::swap( m_ptr, other.m_ptr );
|
uint8_t tmp[sizeof( Vector<T> )];
|
||||||
std::swap( m_size, other.m_size );
|
memcpy( tmp, &other, sizeof( Vector<T> ) );
|
||||||
std::swap( m_capacity, other.m_capacity );
|
memcpy( &other, this, sizeof( Vector<T> ) );
|
||||||
|
memcpy( this, tmp, sizeof( Vector<T> ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
tracy_force_inline bool empty() const { return m_size == 0; }
|
tracy_force_inline bool empty() const { return m_size == 0; }
|
||||||
|
Loading…
Reference in New Issue
Block a user