lua-users home
lua-l archive

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


>  I cannot find a formal method to determine the size of a full userdata
>memory block.

We're planning to add this to Lua 5.1.

>I have found by looking at the lua source that I can cast the
>value returned by lua_touserdata to an int pointer, subtract one from it,
>and dereference it to get the size.  Is there a better way?

You can always store the size in the block itself.
--lhf