mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
Added suport for Fixed Buffers
A fixed buffer keeps a binary chunk "forever", so that the program does not need to copy some of its parts when loading it.
This commit is contained in:
parent
f33cda8d6e
commit
14e416355f
12 changed files with 160 additions and 34 deletions
6
lfunc.c
6
lfunc.c
|
|
@ -265,10 +265,12 @@ Proto *luaF_newproto (lua_State *L) {
|
|||
|
||||
|
||||
void luaF_freeproto (lua_State *L, Proto *f) {
|
||||
luaM_freearray(L, f->code, f->sizecode);
|
||||
if (!(f->flag & PF_FIXED)) {
|
||||
luaM_freearray(L, f->code, f->sizecode);
|
||||
luaM_freearray(L, f->lineinfo, f->sizelineinfo);
|
||||
}
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue