lua-users home
lua-l archive

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


Do you have any (MS) reference material stating that it is wrong?

> The point is, it's wrong to cross link crt versions, but if you want to risk it, go for it..

So regarding FILE handles and memory and similar things, a Lua
extension will allocate whatever, wrap it in userdata, and attach a
__gc method to free it. No other extension or even the hosting lua
application is going to free the whatever by a route other than
calling the __gc, which goes back to the CRT which allocated the
whatever in the first place.

2008/7/22 Ignacio Burgueño <ignaciob@inconcertcc.com>:
> Peter Cawley wrote:
>>
>> Two things should be noted for the CRT version:
>> * The end-user will require the appropriate runtime DLLs for the CRT
>> version (msvcrtXYZ.dll)
>> * Memory allocated with the one CRT version must be de-allocated with
>> that CRT version
>>
>
> Don't forget stuff like file handles. You can't pass a FILE handle from one
> CRT to another.
>
>
>