lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Friday 09 December 2005 20.05, Andreas Stenius wrote:
[...]
> What I'm after is, there still should've been enough memory, should
> only the gc have run in time (somewhere in the middle of the
> function to free up some of the intermediate calculations no longer
> in use..)

Are you certain that the function does away with all references, so 
that the GC can really remove the data before the function is called 
again?

If the function uses global variables, you're at risk of leaving 
"static" data around, that can only be collected after you run the 
function *again*, to point those variables at new data. This can 
cause a function to keep two generations of data alive at all times, 
even though it's only really using one.


//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---