lua-users home
lua-l archive

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

Mike Pall wrote:
> Kay Roepke wrote:
>> (Aside: Can someone comment on the issue that mp actually is
>> dummynode at this point? Would that be correct at all? Just so I
>> know next time when I'm in there...)
> It's a minimal (and read-only!) node structure which is used in case
> a table does not contain any entries in the hash part (yet). 
> It only contains a single nil key/value pair and no free slots.
> So there's always a hash part for every table. This saves some
> conditional jumps in several important code paths. 

Would this optimization suffer if the said node was placed in the
lua_State structure instead of a read-only global ? Does something rely
on the fact that it's in a read-only memory section ?

That would allow having several copies of the Lua lib manipulate the
same lua_State. It's not very clean, but on the other hand it's a
recurrent problem and it would simplify the life of some people. This
would also allow some new functionnality (like hot swapping the Lua dll
without recreating the lua_State).