mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
'lineinfo' in prototypes saved as differences instead of absolute
values, so that the array can use bytes instead of ints, reducing its size. (A new array 'abslineinfo' is used when line differences do not fit in a byte.)
This commit is contained in:
parent
60a7492d24
commit
b42430fd3a
11 changed files with 195 additions and 33 deletions
5
lfunc.c
5
lfunc.c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lfunc.c,v 2.48 2017/04/30 20:43:26 roberto Exp roberto $
|
||||
** $Id: lfunc.c,v 2.49 2017/05/24 18:54:54 roberto Exp roberto $
|
||||
** Auxiliary functions to manipulate prototypes and closures
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
|
@ -119,6 +119,8 @@ Proto *luaF_newproto (lua_State *L) {
|
|||
f->sizecode = 0;
|
||||
f->lineinfo = NULL;
|
||||
f->sizelineinfo = 0;
|
||||
f->abslineinfo = NULL;
|
||||
f->sizeabslineinfo = 0;
|
||||
f->upvalues = NULL;
|
||||
f->sizeupvalues = 0;
|
||||
f->numparams = 0;
|
||||
|
|
@ -138,6 +140,7 @@ void luaF_freeproto (lua_State *L, Proto *f) {
|
|||
luaM_freearray(L, f->p, f->sizep);
|
||||
luaM_freearray(L, f->k, f->sizek);
|
||||
luaM_freearray(L, f->lineinfo, f->sizelineinfo);
|
||||
luaM_freearray(L, f->abslineinfo, f->sizeabslineinfo);
|
||||
luaM_freearray(L, f->locvars, f->sizelocvars);
|
||||
luaM_freearray(L, f->upvalues, f->sizeupvalues);
|
||||
luaM_free(L, f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue