From b42430fd3a6200eaaf4020be90c4d47f7e251b67 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 27 Jun 2017 08:35:31 -0300 Subject: '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.) --- lfunc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lfunc.c') diff --git a/lfunc.c b/lfunc.c index e84538c9..a4a4e29d 100644 --- a/lfunc.c +++ b/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); -- cgit v1.2.3-55-g6feb