mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Using push/pop in all pragma pack pair to avoid potential padding bugs
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
struct StringRef
|
||||
{
|
||||
@@ -663,7 +663,7 @@ struct ChildSample
|
||||
|
||||
enum { ChildSampleSize = sizeof( ChildSample ) };
|
||||
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
struct ThreadData
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
template<typename T, class CompareDefault = std::less<T>>
|
||||
class SortedVector
|
||||
{
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
uint32_t sortedEnd;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
enum { SortedVectorSize = sizeof( SortedVector<int> ) };
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
template<typename T>
|
||||
class VarArray
|
||||
{
|
||||
@@ -56,7 +56,7 @@ private:
|
||||
uint32_t m_hash;
|
||||
const short_ptr<T> m_ptr;
|
||||
};
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
enum { VarArraySize = sizeof( VarArray<int> ) };
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
template<typename T>
|
||||
class Vector
|
||||
{
|
||||
@@ -348,7 +348,7 @@ private:
|
||||
template<typename T> struct VectorAdapterDirect { const T& operator()( const T& it ) const { return it; } };
|
||||
template<typename T> struct VectorAdapterPointer { const T& operator()( const short_ptr<T>& it ) const { return *it; } };
|
||||
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
enum { VectorSize = sizeof( Vector<int> ) };
|
||||
|
||||
|
||||
@@ -158,13 +158,13 @@ public:
|
||||
uint8_t inlineFrame;
|
||||
};
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
struct GhostKey
|
||||
{
|
||||
CallstackFrameId frame;
|
||||
uint8_t inlineFrame;
|
||||
};
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
struct GhostKeyHasher
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user