[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Shoehorning into 64 KB
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 17 May 2001 06:57:21 -0300 (EST)
>is it also possible to unload or garbage-collect code that is no longer needed?
Code is treated just any other value: it's garbage-collected when there are no
references to it.
So, for instance, in
function f() print"ok" end
f()
f=22
The function create in this chunk will be collected next time GC runs.
If your functions are stored in global variables, just setting those variables
to nil wil mark the functions to be collected.
(All this explanation works for all kinds of values, not just functions.)
--lhf