Core/Utils: Added helper function to make creating unique_ptr with custom deleters more convenient

# Conflicts:
#	src/server/game/World/World.cpp
This commit is contained in:
Shauren authored and Ovahlord committed 2022-06-19 21:42:45 +02:00
1 parent fc0dc939ba
commit 8733f6fafa
3 files changed
+53 -5

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#ifndef TRINITY_DETOUR_MEMORY_FUNCTIONS_H
#define TRINITY_DETOUR_MEMORY_FUNCTIONS_H
#include "DetourAlloc.h"
// memory management
inline void* dtCustomAlloc(size_t size, dtAllocHint /*hint*/)
{
return (void*)new unsigned char[size];
}
inline void dtCustomFree(void* ptr)
{
delete [] (unsigned char*)ptr;
}
#endif // TRINITY_DETOUR_MEMORY_FUNCTIONS_H