lua-users home
lua-l archive

Re: setfenv on userdata

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


> I would have expected userdata to support nil environments as
> well. Amongst other things, this is one less link for the GC to trace
> even if it routinely leads to a table that is already marked.
That would save one memory read when tracing the environment.
On the other hand, it would be strange to allow nil environments in
userdata but not in other types. And it would make setfenv/getfenv
more complex.
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /