sq_getsize

Squirrel 3.0

sq_getsize

SQObjectType sq_getsize(HSQUIRRELVM v, SQInteger idx);

returns the size of a value at the idx position in the stack, if the value is a class or a class instance the size returned is the size of the userdata buffer(see sq_setclassudsize).

parameters:
HSQUIRRELVM v

the target VM

SQInteger idx

an index in the stack

return:

the size of the value at the position idx in the stack

remarks:

this function only works with strings,arrays,tables,classes,instances and userdata if the value is not a valid type types the function will return –1.