mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 06:34:36 +00:00
Using push/pop in all pragma pack pair to avoid potential padding bugs
This commit is contained in:
parent
eeffb6d25c
commit
dc74b8adfd
@ -34,7 +34,7 @@ enum HandshakeStatus : uint8_t
|
||||
enum { WelcomeMessageProgramNameSize = 64 };
|
||||
enum { WelcomeMessageHostInfoSize = 1024 };
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
// Must increase left query space after handling!
|
||||
enum ServerQuery : uint8_t
|
||||
@ -133,7 +133,7 @@ struct BroadcastMessage
|
||||
|
||||
enum { BroadcastMessageSize = sizeof( BroadcastMessage ) };
|
||||
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ enum class QueueType : uint8_t
|
||||
NUM_TYPES
|
||||
};
|
||||
|
||||
#pragma pack( 1 )
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
struct QueueThreadContext
|
||||
{
|
||||
@ -745,7 +745,7 @@ struct QueueItem
|
||||
QueueFiberLeave fiberLeave;
|
||||
};
|
||||
};
|
||||
#pragma pack()
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
enum { QueueItemSize = sizeof( QueueItem ) };
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user