mirror of
https://github.com/lua/lua
synced 2025-04-12 07:53:16 +03:00
details (comments)
This commit is contained in:
parent
c231a5e2b6
commit
c5112f7b15
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lauxlib.h,v 1.127 2014/10/25 11:50:46 roberto Exp roberto $
|
** $Id: lauxlib.h,v 1.128 2014/10/29 16:11:17 roberto Exp roberto $
|
||||||
** Auxiliary functions for building Lua libraries
|
** Auxiliary functions for building Lua libraries
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -65,7 +65,7 @@ LUALIB_API int (luaL_checkoption) (lua_State *L, int arg, const char *def,
|
|||||||
LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname);
|
LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname);
|
||||||
LUALIB_API int (luaL_execresult) (lua_State *L, int stat);
|
LUALIB_API int (luaL_execresult) (lua_State *L, int stat);
|
||||||
|
|
||||||
/* pre-defined references */
|
/* predefined references */
|
||||||
#define LUA_NOREF (-2)
|
#define LUA_NOREF (-2)
|
||||||
#define LUA_REFNIL (-1)
|
#define LUA_REFNIL (-1)
|
||||||
|
|
||||||
|
6
ldblib.c
6
ldblib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldblib.c,v 1.149 2015/02/19 17:06:21 roberto Exp roberto $
|
** $Id: ldblib.c,v 1.150 2015/11/19 19:16:22 roberto Exp roberto $
|
||||||
** Interface from Lua to its debug API
|
** Interface from Lua to its debug API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -28,8 +28,8 @@ static const int HOOKKEY = 0;
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** If L1 != L, L1 can be in any state, and therefore there is no
|
** If L1 != L, L1 can be in any state, and therefore there are no
|
||||||
** garantees about its stack space; any push in L1 must be
|
** guarantees about its stack space; any push in L1 must be
|
||||||
** checked.
|
** checked.
|
||||||
*/
|
*/
|
||||||
static void checkstack (lua_State *L, lua_State *L1, int n) {
|
static void checkstack (lua_State *L, lua_State *L1, int n) {
|
||||||
|
4
ldo.h
4
ldo.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.h,v 2.26 2015/11/13 13:24:26 roberto Exp roberto $
|
** $Id: ldo.h,v 2.27 2015/11/19 19:16:22 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -16,7 +16,7 @@
|
|||||||
/*
|
/*
|
||||||
** Macro to check stack size and grow stack if needed. Parameters
|
** Macro to check stack size and grow stack if needed. Parameters
|
||||||
** 'pre'/'pos' allow the macro to preserve a pointer into the
|
** 'pre'/'pos' allow the macro to preserve a pointer into the
|
||||||
** stack across realocations, doing the work only when needed.
|
** stack across reallocations, doing the work only when needed.
|
||||||
** 'condmovestack' is used in heavy tests to force a stack reallocation
|
** 'condmovestack' is used in heavy tests to force a stack reallocation
|
||||||
** at every check.
|
** at every check.
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: loadlib.c,v 1.125 2015/01/13 13:18:04 roberto Exp roberto $
|
** $Id: loadlib.c,v 1.126 2015/02/16 13:14:33 roberto Exp roberto $
|
||||||
** Dynamic library loader for Lua
|
** Dynamic library loader for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
**
|
**
|
||||||
@ -732,7 +732,7 @@ static void createsearcherstable (lua_State *L) {
|
|||||||
int i;
|
int i;
|
||||||
/* create 'searchers' table */
|
/* create 'searchers' table */
|
||||||
lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0);
|
lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0);
|
||||||
/* fill it with pre-defined searchers */
|
/* fill it with predefined searchers */
|
||||||
for (i=0; searchers[i] != NULL; i++) {
|
for (i=0; searchers[i] != NULL; i++) {
|
||||||
lua_pushvalue(L, -2); /* set 'package' as upvalue for all searchers */
|
lua_pushvalue(L, -2); /* set 'package' as upvalue for all searchers */
|
||||||
lua_pushcclosure(L, searchers[i], 1);
|
lua_pushcclosure(L, searchers[i], 1);
|
||||||
|
4
lvm.c
4
lvm.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lvm.c,v 2.263 2015/11/17 16:00:28 roberto Exp roberto $
|
** $Id: lvm.c,v 2.264 2015/11/19 19:16:22 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -1254,7 +1254,7 @@ void luaV_execute (lua_State *L) {
|
|||||||
h = hvalue(ra);
|
h = hvalue(ra);
|
||||||
last = ((c-1)*LFIELDS_PER_FLUSH) + n;
|
last = ((c-1)*LFIELDS_PER_FLUSH) + n;
|
||||||
if (last > h->sizearray) /* needs more space? */
|
if (last > h->sizearray) /* needs more space? */
|
||||||
luaH_resizearray(L, h, last); /* pre-allocate it at once */
|
luaH_resizearray(L, h, last); /* preallocate it at once */
|
||||||
for (; n > 0; n--) {
|
for (; n > 0; n--) {
|
||||||
TValue *val = ra+n;
|
TValue *val = ra+n;
|
||||||
luaH_setint(L, h, last--, val);
|
luaH_setint(L, h, last--, val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user