summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/stdafx.h
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-02-01 12:58:04 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-02-01 12:58:04 +0000
commit014e23323d6dc79605da8ebad1c357176ede9122 (patch)
tree783042c8aba1d71645028720bac8f8f70eca3b54 /plugins/MirLua/src/stdafx.h
parente1b171840899382e773c89b21e0510e9eddd95b0 (diff)
MirLua: Code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@16206 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/stdafx.h')
-rw-r--r--plugins/MirLua/src/stdafx.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/MirLua/src/stdafx.h b/plugins/MirLua/src/stdafx.h
index efefd020ad..90e60660d8 100644
--- a/plugins/MirLua/src/stdafx.h
+++ b/plugins/MirLua/src/stdafx.h
@@ -47,6 +47,14 @@ struct luaM_const
intptr_t value;
};
+template<typename T>
+T *mir_memdup(T* ptr, size_t size = sizeof(T), bool bCalloc = false)
+{
+ void *newptr = (bCalloc ? mir_calloc : mir_alloc)(size);
+ memcpy(newptr, ptr, size);
+ return (T*)newptr;
+}
+
#include "mlua.h"
#include "mlua_script.h"
#include "mlua_module_loader.h"