[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: En: Re: Freeing Lua scripts
- From: Andre de Leiradella <leiradella@...>
- Date: Thu, 26 Jun 2003 14:51:35 -0300
Duh, how dumb I am...
Only after I sent the message I realized that lua_load can read bytes from
anywhere, they don't even need to be in memory. In fact, luareader can even
load gzipped or bzipped scripts, decompressing bytes on the fly to feed
lua_load which won't exist anymore after the file has been loaded by Lua...
So to answer myself, yes, you can do whatever you want with your script
files after Lua loads them: dispose, memset(script, 0, sizeof(script)) etc.
Sorry for the noise.
Andre de Leiradella
----- Original Message -----
From: Andre de Leiradella <firstname.lastname@example.org>
Sent: Thursday, June 26, 2003 12:24 PM
Subject: RE: Re: Freeing Lua scripts
> >>Is it true that after executing Lua scripts, being them plain source
> >>pre-compiled chunks, with lua_load and lua_pcall I call release the
> >>used to hold them? I believe so, but I want to make sure I can do that.
> >You mean, Lua scripts stored in memory? If so, you can release them right
> >after you load them. The strings holding the scripts are not needed when
> >chunks are executed.
> Yes, that's what I meant. But not only strings (in the sense of Lua source
> code), can pre-compiled scripts be freed after I lua_load and lua_pcall
> Thank you,
> Andre de Leiradella