1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add secure alloc/free macros.

This commit is contained in:
Bartosz Taudul
2020-06-24 01:33:26 +02:00
parent 530e464347
commit 4bbeb51e34
4 changed files with 52 additions and 24 deletions
+8 -4
View File
@@ -349,8 +349,9 @@ public:
TracyLfqCommit;
}
static tracy_force_inline void MemAlloc( const void* ptr, size_t size )
static tracy_force_inline void MemAlloc( const void* ptr, size_t size, bool secure )
{
if( secure && !ProfilerAvailable() ) return;
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
@@ -361,8 +362,9 @@ public:
GetProfiler().m_serialLock.unlock();
}
static tracy_force_inline void MemFree( const void* ptr )
static tracy_force_inline void MemFree( const void* ptr, bool secure )
{
if( secure && !ProfilerAvailable() ) return;
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
@@ -373,8 +375,9 @@ public:
GetProfiler().m_serialLock.unlock();
}
static tracy_force_inline void MemAllocCallstack( const void* ptr, size_t size, int depth )
static tracy_force_inline void MemAllocCallstack( const void* ptr, size_t size, int depth, bool secure )
{
if( secure && !ProfilerAvailable() ) return;
#ifdef TRACY_HAS_CALLSTACK
auto& profiler = GetProfiler();
# ifdef TRACY_ON_DEMAND
@@ -394,8 +397,9 @@ public:
#endif
}
static tracy_force_inline void MemFreeCallstack( const void* ptr, int depth )
static tracy_force_inline void MemFreeCallstack( const void* ptr, int depth, bool secure )
{
if( secure && !ProfilerAvailable() ) return;
#ifdef TRACY_HAS_CALLSTACK
auto& profiler = GetProfiler();
# ifdef TRACY_ON_DEMAND