tracy/common/TracyAlloc.hpp

33 lines
432 B
C++
Raw Normal View History

2017-10-14 14:52:05 +00:00
#ifndef __TRACYALLOC_HPP__
#define __TRACYALLOC_HPP__
#include <cstdlib>
2017-10-14 14:52:05 +00:00
#ifdef TRACY_ENABLE
# include "../client/tracy_rpmalloc.hpp"
#endif
2017-10-14 14:52:05 +00:00
namespace tracy
{
static inline void* tracy_malloc( size_t size )
{
#ifdef TRACY_ENABLE
2017-10-14 14:52:05 +00:00
return rpmalloc( size );
#else
return malloc( size );
#endif
2017-10-14 14:52:05 +00:00
}
static inline void tracy_free( void* ptr )
{
#ifdef TRACY_ENABLE
2017-10-14 14:52:05 +00:00
rpfree( ptr );
#else
free( ptr );
#endif
2017-10-14 14:52:05 +00:00
}
}
#endif