mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

TracyAlign.hpp (394B)


      1 #ifndef __TRACYALIGN_HPP__
      2 #define __TRACYALIGN_HPP__
      3 
      4 #include <string.h>
      5 
      6 #include "TracyForceInline.hpp"
      7 
      8 namespace tracy
      9 {
     10 
     11 template<typename T>
     12 tracy_force_inline T MemRead( const void* ptr )
     13 {
     14     T val;
     15     memcpy( &val, ptr, sizeof( T ) );
     16     return val;
     17 }
     18 
     19 template<typename T>
     20 tracy_force_inline void MemWrite( void* ptr, T val )
     21 {
     22     memcpy( ptr, &val, sizeof( T ) );
     23 }
     24 
     25 }
     26 
     27 #endif