lua-users home
lua-l archive

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


There's been some discussion of this in the past, if you search the list.

My understanding is basically: Yes, it's possible.

However, you will then get everyone linking their own copy of the lua
runtime into their extension code (because this is easy and works) and
start getting subtle hard to debug errors when the runtime linked is
not == the runtime of the lua state.

I doubt it'd be implemented in the library any time soon.

(You'd basically have to have someone champion it as a cause to
convince people it was a worthy goal and then write the code for it
themselves; and then finally get it accepted as a mainline change; I
foresee some difficulties in that path :)

~
Doug.

On Tue, Aug 7, 2012 at 1:24 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
> is that possible to make lua static free? I mean, makes it's static variable
> become a field in lua_State? that may makes cross call lua c function safe.
>
> regards,
> Xavier Wang.
>
> 在 2012-8-4 下午1:54,"steve donovan" <steve.j.donovan@gmail.com>写道:
>
>> On Sat, Aug 4, 2012 at 5:07 AM, Doug <douglas.linder@gmail.com> wrote:
>> > The only situation (it seems) that this is possible is in the
>> > astonishingly rare case of lua being loaded as a dynamic library.
>>
>> Which is how it's done on Windows, and that's not too rare ;)
>>
>> Besides, it's recommended to use a .so when embedding Lua, since a
>> static link can easily leave out bits that you'll need later when you
>> start scripting.
>>
>> steve d.
>>
>