[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Size of full userdata
- From: "Dan East" <dan@...>
- Date: Tue, 15 Jun 2004 23:28:59 -0400
I cannot find a formal method to determine the size of a full userdata
memory block. 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?
void *pData=lua_touserdata(L);
int nSize=*(((int *)pData)-1);
Dan East