TracyAlloc.hpp (434B)
1 #ifndef __TRACYALLOC_HPP__ 2 #define __TRACYALLOC_HPP__ 3 4 #include <stdlib.h> 5 6 #ifdef TRACY_ENABLE 7 # include "../client/tracy_rpmalloc.hpp" 8 #endif 9 10 namespace tracy 11 { 12 13 static inline void* tracy_malloc( size_t size ) 14 { 15 #ifdef TRACY_ENABLE 16 return rpmalloc( size ); 17 #else 18 return malloc( size ); 19 #endif 20 } 21 22 static inline void tracy_free( void* ptr ) 23 { 24 #ifdef TRACY_ENABLE 25 rpfree( ptr ); 26 #else 27 free( ptr ); 28 #endif 29 } 30 31 } 32 33 #endif