[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua C API can't be used from other languages without C wrappers
- From: Pierre Chapuis <catwell@...>
- Date: Wed, 21 Feb 2018 12:26:15 +0100
On Tue, Feb 20, 2018, at 20:46, Roberto Ierusalimschy wrote:
> > - Several code examples in PiL will leak resources if allocation fails,
> > e.g. the readdir example in listing 29.1 will leak the directory handler.
>
> The readdir example is clear about its leak, and the book presents another
> (and better, in my view) implementation that does not leak. I would like
> to know about the other code examples that leak resources.
I'm sorry, that's true, I forgot about that, and I'm not even sure there
are other examples that leak anything in PiL.
For memory, PiL typically uses userdata or luaL_Buffer and not plain
malloc, which avoids the problem.
--
Pierre Chapuis