lua-users home
lua-l archive

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

On Sun, Jan 1, 2012 at 8:00 PM,  <> wrote:
> Hi, if I wanted to modify lua to catch every creation of a complex data type
> (anything other than nil, number, boolean, string) so that I can assign a
> uid to it, would the right place be the set*value macros in lobject.h?
> Holly.

Userdata are created from luaS_newudata in lstring.c.
Strings are created from luaS_newlstr in lstring.c.
Everything else is created by a function which calls luaC_link in lgc.c:
luaF_newCclosure, luaF_newLclosure, luaF_newupval, luaF_newproto in lfunc.c.
luaH_new in ltable.c.
luaE_newthread in lstate.c

Those are the functions which I'd go after, rather than macros from lobject.h.