tracy/public/common/TracyAlign.hpp

28 lines
394 B
C++
Raw Normal View History

2018-03-31 11:13:15 +00:00
#ifndef __TRACYALIGN_HPP__
#define __TRACYALIGN_HPP__
#include <string.h>
#include "TracyForceInline.hpp"
namespace tracy
{
template<typename T>
2018-07-10 23:33:27 +00:00
tracy_force_inline T MemRead( const void* ptr )
2018-03-31 11:13:15 +00:00
{
T val;
memcpy( &val, ptr, sizeof( T ) );
return val;
}
template<typename T>
2018-04-03 14:45:55 +00:00
tracy_force_inline void MemWrite( void* ptr, T val )
2018-03-31 11:13:15 +00:00
{
memcpy( ptr, &val, sizeof( T ) );
}
}
#endif