[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: R: Re: How to export associative arrays to an embedded lua script?
- From: "linuxfan@..." <linuxfan@...>
- Date: Mon, 12 Oct 2015 15:03:32 +0200 (CEST)
>storing the lua value for my just created tables, and they work as
>expected. Dirk said that this is not a good idea, because lua doesn't
>assure the pointer stays valid, perhaps after a garbage collection
First of all, sorry - I don't understand how to post correctly under a
given topic. It's easy to start a topic, not so easy to post a message
and make it go under the correct thread.
Second, sorry again - I don't
want to be pedantic, but someone could explain me better than the
Here: http://www.lua.org/manual/5.2/manual.html#4.5the lua manual says
that a host application can store data in the registry, and also says
that "you should use as key a string containing your library name, ...,
or any Lua object created by your code". What I understand is that "lua
objects created by your code" means "created by the host application".
If so, this implies that it is safe to take the lua value for an object
(say, "its pointer"), and use it in whatever manner because that value
will never change (as long as the object exists, of course). If such a
value is good to be used as a key in the registry, it is also good to
be used as a key in the host application. or not?
Thank you, regards,