mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
rewrite SSM and clonefunction
This commit is contained in:
@@ -699,9 +699,7 @@ static int skipcomment (LoadF *lf, int *cp) {
|
||||
else return 0; /* no comment */
|
||||
}
|
||||
|
||||
LUA_API void luaS_expandshr(int n);
|
||||
|
||||
static int luaL_loadfilex_ (lua_State *L, const char *filename,
|
||||
LUALIB_API int luaL_loadfilex_ (lua_State *L, const char *filename,
|
||||
const char *mode) {
|
||||
LoadF lf;
|
||||
int status, readstatus;
|
||||
@@ -725,9 +723,7 @@ static int luaL_loadfilex_ (lua_State *L, const char *filename,
|
||||
}
|
||||
if (c != EOF)
|
||||
lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */
|
||||
luaS_expandshr(4096);
|
||||
status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
|
||||
luaS_expandshr(-4096);
|
||||
readstatus = ferror(lf.f);
|
||||
if (filename) fclose(lf.f); /* close file (even in case of errors) */
|
||||
if (readstatus) {
|
||||
@@ -1181,6 +1177,7 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,
|
||||
lua_close(eL);
|
||||
return err;
|
||||
}
|
||||
lua_sharefunction(eL, -1);
|
||||
proto = lua_topointer(eL, -1);
|
||||
const void * oldv = save(filename, proto);
|
||||
if (oldv) {
|
||||
|
||||
Reference in New Issue
Block a user