lua-users home
lua-l archive

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


Now before I start confusing myself past what I already am (medication isn't helping), I'd like someone to confirm that the following description of how Lua's data structures are built internally and that I'm not going insane.

(Just check the src again to make sure, and now I'm certain I'm going insane. Probably will become as clear as day once someone actually explains it...)

Create a new state -> Returns a lua_State structure
With that state you also created indirectly a global_State structure which holds the 'real' state (the one all 'threads' share) Create a new coroutine ('thread', why can't we use the same terminology?) spawns a new lua_State and makes it point to the global_State that it's parent points to.

So lua_State is more of a coroutine instance and global_State holds all the real meat of that Lua universe. Now all I need to figure out is what the LG structure does. (No bloody clue. It seems to be some sort of marker to specify the size of an empty global state and one lua state. Right?)

Thanks for any clarification,
Olivier