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.) --- lundump.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lundump.c') diff --git a/lundump.c b/lundump.c index 13916bc1..7fb05762 100644 --- a/lundump.c +++ b/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 2.43 2015/09/17 15:51:05 roberto Exp roberto $ +** $Id: lundump.c,v 2.44 2015/11/02 16:09:30 roberto Exp roberto $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -180,10 +180,17 @@ static void LoadUpvalues (LoadState *S, Proto *f) { static void LoadDebug (LoadState *S, Proto *f) { int i, n; n = LoadInt(S); - f->lineinfo = luaM_newvector(S->L, n, int); + f->lineinfo = luaM_newvector(S->L, n, ls_byte); f->sizelineinfo = n; LoadVector(S, f->lineinfo, n); n = LoadInt(S); + f->abslineinfo = luaM_newvector(S->L, n, AbsLineInfo); + f->sizeabslineinfo = n; + for (i = 0; i < n; i++) { + f->abslineinfo[i].pc = LoadInt(S); + f->abslineinfo[i].line = LoadInt(S); + } + n = LoadInt(S); f->locvars = luaM_newvector(S->L, n, LocVar); f->sizelocvars = n; for (i = 0; i < n; i++) -- cgit v1.2.3-55-g6feb