C.sizeof(object)



Gets the memory size in bytes of the provided C object.

object

A C object instance to get the size from, which can be any of the following :

Return value

Returns the type of the C object as a number

Example

local c = require 'c' -- Defines a C Value of type "double", initialized with the number 3.141592654 local pi = c.double(3.141592654) -- Prints the pi size in bytes print(c.sizeof(pi))