mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Merge pull request #440 from Danielmelody/master
Using push/pop in all pragma pack pair to avoid potential padding bugs
This commit is contained in:
commit
fc7b3c3c0e
@ -34,7 +34,7 @@ enum HandshakeStatus : uint8_t
|
|||||||
enum { WelcomeMessageProgramNameSize = 64 };
|
enum { WelcomeMessageProgramNameSize = 64 };
|
||||||
enum { WelcomeMessageHostInfoSize = 1024 };
|
enum { WelcomeMessageHostInfoSize = 1024 };
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
|
|
||||||
// Must increase left query space after handling!
|
// Must increase left query space after handling!
|
||||||
enum ServerQuery : uint8_t
|
enum ServerQuery : uint8_t
|
||||||
@ -133,7 +133,7 @@ struct BroadcastMessage
|
|||||||
|
|
||||||
enum { BroadcastMessageSize = sizeof( BroadcastMessage ) };
|
enum { BroadcastMessageSize = sizeof( BroadcastMessage ) };
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack( pop )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ enum class QueueType : uint8_t
|
|||||||
NUM_TYPES
|
NUM_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
|
|
||||||
struct QueueThreadContext
|
struct QueueThreadContext
|
||||||
{
|
{
|
||||||
@ -745,7 +745,7 @@ struct QueueItem
|
|||||||
QueueFiberLeave fiberLeave;
|
QueueFiberLeave fiberLeave;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack( pop )
|
||||||
|
|
||||||
|
|
||||||
enum { QueueItemSize = sizeof( QueueItem ) };
|
enum { QueueItemSize = sizeof( QueueItem ) };
|
||||||
|
@ -114,7 +114,7 @@ struct THREADNAME_INFO
|
|||||||
DWORD dwThreadID;
|
DWORD dwThreadID;
|
||||||
DWORD dwFlags;
|
DWORD dwFlags;
|
||||||
};
|
};
|
||||||
# pragma pack(pop)
|
# pragma pack( pop )
|
||||||
|
|
||||||
void ThreadNameMsvcMagic( const THREADNAME_INFO& info )
|
void ThreadNameMsvcMagic( const THREADNAME_INFO& info )
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
|
|
||||||
struct StringRef
|
struct StringRef
|
||||||
{
|
{
|
||||||
@ -663,7 +663,7 @@ struct ChildSample
|
|||||||
|
|
||||||
enum { ChildSampleSize = sizeof( ChildSample ) };
|
enum { ChildSampleSize = sizeof( ChildSample ) };
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack( pop )
|
||||||
|
|
||||||
|
|
||||||
struct ThreadData
|
struct ThreadData
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
template<typename T, class CompareDefault = std::less<T>>
|
template<typename T, class CompareDefault = std::less<T>>
|
||||||
class SortedVector
|
class SortedVector
|
||||||
{
|
{
|
||||||
@ -118,7 +118,7 @@ private:
|
|||||||
uint32_t sortedEnd;
|
uint32_t sortedEnd;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack( pop )
|
||||||
|
|
||||||
enum { SortedVectorSize = sizeof( SortedVector<int> ) };
|
enum { SortedVectorSize = sizeof( SortedVector<int> ) };
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class VarArray
|
class VarArray
|
||||||
{
|
{
|
||||||
@ -56,7 +56,7 @@ private:
|
|||||||
uint32_t m_hash;
|
uint32_t m_hash;
|
||||||
const short_ptr<T> m_ptr;
|
const short_ptr<T> m_ptr;
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack( pop )
|
||||||
|
|
||||||
enum { VarArraySize = sizeof( VarArray<int> ) };
|
enum { VarArraySize = sizeof( VarArray<int> ) };
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Vector
|
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 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; } };
|
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> ) };
|
enum { VectorSize = sizeof( Vector<int> ) };
|
||||||
|
|
||||||
|
@ -158,13 +158,13 @@ public:
|
|||||||
uint8_t inlineFrame;
|
uint8_t inlineFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack( 1 )
|
#pragma pack( push, 1 )
|
||||||
struct GhostKey
|
struct GhostKey
|
||||||
{
|
{
|
||||||
CallstackFrameId frame;
|
CallstackFrameId frame;
|
||||||
uint8_t inlineFrame;
|
uint8_t inlineFrame;
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack( pop )
|
||||||
|
|
||||||
struct GhostKeyHasher
|
struct GhostKeyHasher
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user