mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Force inline small functions.
This commit is contained in:
@@ -23,7 +23,7 @@ public:
|
||||
using iterator = T*;
|
||||
using const_iterator = const T*;
|
||||
|
||||
Vector()
|
||||
tracy_force_inline Vector()
|
||||
: m_ptr( nullptr )
|
||||
, m_size( 0 )
|
||||
, m_capacity( 0 )
|
||||
@@ -31,13 +31,13 @@ public:
|
||||
}
|
||||
|
||||
Vector( const Vector& ) = delete;
|
||||
Vector( Vector&& src ) noexcept
|
||||
tracy_force_inline Vector( Vector&& src ) noexcept
|
||||
{
|
||||
memcpy( this, &src, sizeof( Vector<T> ) );
|
||||
memset( &src, 0, sizeof( Vector<T> ) );
|
||||
}
|
||||
|
||||
Vector( const T& value )
|
||||
tracy_force_inline Vector( const T& value )
|
||||
: m_ptr( new T[1] )
|
||||
, m_size( 1 )
|
||||
, m_capacity( 0 )
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
m_ptr[0] = value;
|
||||
}
|
||||
|
||||
~Vector()
|
||||
tracy_force_inline ~Vector()
|
||||
{
|
||||
if( m_capacity != std::numeric_limits<uint8_t>::max() )
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
}
|
||||
|
||||
Vector& operator=( const Vector& ) = delete;
|
||||
Vector& operator=( Vector&& src ) noexcept
|
||||
tracy_force_inline Vector& operator=( Vector&& src ) noexcept
|
||||
{
|
||||
delete[] m_ptr;
|
||||
memcpy( this, &src, sizeof( Vector<T> ) );
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
void swap( Vector& other )
|
||||
tracy_force_inline void swap( Vector& other )
|
||||
{
|
||||
std::swap( m_ptr, other.m_ptr );
|
||||
std::swap( m_size, other.m_size );
|
||||
|
||||
Reference in New Issue
Block a user