[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is breaking out of io.lines(file) safe?
- From: Patrick Donnelly <batrick@...>
- Date: Mon, 21 Mar 2011 15:40:36 -0400
On Mon, Mar 21, 2011 at 1:51 PM, Steve Litt <slitt@troubleshooters.com> wrote:
> In the same vain, in C I always free()
> whatever I malloc(), even though I know the memory will be given back on
> program termination.
This isn't really the best (or fair) analogy. Your memory is never
eventually garbage collected *during* program execution. In contrast,
the files Lua opens will eventually be garbage collected (and thus
closed).
--
- Patrick Donnelly