mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Move TracyAlloc.hpp to common. Use rpmalloc only if TRACY_ENABLE.
This commit is contained in:
parent
c5ea9c744c
commit
fc94378e0c
@ -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"
|
||||
|
@ -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>
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "../common/TracySystem.hpp"
|
||||
#include "TracyAlloc.hpp"
|
||||
#include "../common/TracyAlloc.hpp"
|
||||
#include "TracyProfiler.hpp"
|
||||
|
||||
namespace tracy
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user