summaryrefslogtreecommitdiff
path: root/src/tsg_lua_func.cpp
diff options
context:
space:
mode:
authorpengxuanzheng <[email protected]>2020-09-02 14:57:12 +0800
committerpengxuanzheng <[email protected]>2020-09-02 14:57:12 +0800
commit1573688b5ac8afa62a5a52ee06d81a410df05090 (patch)
treefbd58500f18cea9a73e9c41c7f437569be2eb3a1 /src/tsg_lua_func.cpp
parente009d14697bd886830366d185b574ea563db1ee1 (diff)
修改3rd为support
Diffstat (limited to 'src/tsg_lua_func.cpp')
-rw-r--r--src/tsg_lua_func.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/tsg_lua_func.cpp b/src/tsg_lua_func.cpp
index 299cab1..ba53492 100644
--- a/src/tsg_lua_func.cpp
+++ b/src/tsg_lua_func.cpp
@@ -14,8 +14,7 @@ extern "C"
#include "luajit.h"
#include "lauxlib.h"
}
-#include<tcmalloc.h>
-#include"../include/tsg_lua_interface.h"
+#include"tsg_lua_interface.h"
#ifndef MIN
#define MIN(a,b) (((a) < (b))?(a):(b))
@@ -469,33 +468,19 @@ int tsg_lua_memmem(lua_State *L)
return 2;
}
-#if 0
-static void *mem_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
-{
- (void)ud;
- (void)osize;
- if (nsize == 0) {
- tc_free(ptr);
- return NULL;
- } else {
- return tc_realloc(ptr, nsize);
- }
-}
-#endif
tsg_lua_handle tsg_lua_vm_create()
{
lua_State *L;
- jmp_buf *lua_exception = (jmp_buf *)tc_malloc(sizeof(jmp_buf));
+ jmp_buf *lua_exception = (jmp_buf *)malloc(sizeof(jmp_buf));
if (lua_exception == NULL)
{
return NULL;
}
L = luaL_newstate();
- //L = lua_newstate(mem_alloc, NULL);
if (L == NULL)
{
- tc_free(lua_exception);
+ free(lua_exception);
return NULL;
}
lua_setexdata(L, lua_exception);
@@ -1319,7 +1304,7 @@ int tsg_destory_lua(tsg_lua_handle lua)
lua_exception = (jmp_buf *)lua_getexdata(L);
if (lua_exception != NULL)
{
- tc_free(lua_exception);
+ free(lua_exception);
}
lua_close(L);