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:
1 parent
fc0dc939ba
commit
8733f6fafa
3 files changed
+53
-5
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user