Move TracyAlloc.hpp to common. Use rpmalloc only if TRACY_ENABLE.

This commit is contained in:
Bartosz Taudul 2017-10-18 19:08:19 +02:00
parent c5ea9c744c
commit fc94378e0c
5 changed files with 14 additions and 5 deletions

View File

@ -22,7 +22,6 @@
#include "../common/TracySocket.hpp"
#include "../common/TracySystem.hpp"
#include "tracy_rpmalloc.hpp"
#include "TracyAlloc.hpp"
#include "TracyScoped.hpp"
#include "TracyProfiler.hpp"
#include "TracyThread.hpp"

View File

@ -9,7 +9,7 @@
#include "concurrentqueue.h"
#include "../common/tracy_lz4.hpp"
#include "../common/TracyQueue.hpp"
#include "TracyAlloc.hpp"
#include "../common/TracyAlloc.hpp"
#if defined _MSC_VER || defined __CYGWIN__
# include <intrin.h>

View File

@ -5,7 +5,7 @@
#include <string.h>
#include "../common/TracySystem.hpp"
#include "TracyAlloc.hpp"
#include "../common/TracyAlloc.hpp"
#include "TracyProfiler.hpp"
namespace tracy

View File

@ -38,7 +38,7 @@
# define tracy_force_inline inline
#endif
#include "TracyAlloc.hpp"
#include "../common/TracyAlloc.hpp"
#if defined(__GNUC__)
// Disable -Wconversion warnings (spuriously triggered when Traits::size_t and

View File

@ -1,19 +1,29 @@
#ifndef __TRACYALLOC_HPP__
#define __TRACYALLOC_HPP__
#include "tracy_rpmalloc.hpp"
#ifdef TRACY_ENABLE
# include "../client/tracy_rpmalloc.hpp"
#endif
namespace tracy
{
static inline void* tracy_malloc( size_t size )
{
#ifdef TRACY_ENABLE
return rpmalloc( size );
#else
return malloc( size );
#endif
}
static inline void tracy_free( void* ptr )
{
#ifdef TRACY_ENABLE
rpfree( ptr );
#else
free( ptr );
#endif
}
}