[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luac and dumping code
- From: Daniel Silverstone <dsilvers@...>
- Date: Sat, 6 Oct 2001 12:18:43 +0100
On Fri, Oct 05, 2001 at 08:40:01PM -0300, Luiz Henrique de Figueiredo wrote:
> In 4.1, you have loadfile and loadbuffer leave precompiled stuff in the stack.
> If you want the exact binary representation used by luac, use ldumplib.c in
> src/luac.
In what form does this leave the code on the stack? -- loadfile/buffer seems
to leave a Closure* and the ldumplib is doing something odd with luaM_buffer
or something.
> strip in luac.c does not care about freeing, because luac is a standalone
> program. If you copy the code of strip into your application unchanged, it
> will leak memory. To fix this, add these lines at the beginning of strip:
> luaM_freearray(L, f->lineinfo, f->sizelineinfo, int);
> luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar);
Cool -- this looks exactly like what I was after.
You're a star.
Thanks
Daniel
--
Daniel Silverstone http://www.digital-scurf.org/
Hostmaster, Webmaster, and Chief Code Wibbler Digital-Scurf Unlimited
GPG Public key available from germany.keyserver.net KeyId: 20687895
If you refuse to accept anything but the best you very often get it.