From 014e23323d6dc79605da8ebad1c357176ede9122 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Mon, 1 Feb 2016 12:58:04 +0000 Subject: MirLua: Code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@16206 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/stdafx.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/MirLua/src/stdafx.h') 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 +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" -- cgit v1.2.3