Value.size readonly



The Value.size property gets the current C Value size in memory, in bytes.

Notes

  • This property returns the same result as the # length operator
  • For C strings and wide strings, the property includes the last zero character in the byte count.

Example

local c = require "c" -- Much simpler alternative is to use _ARCH global variable local function get_arch() -- check the C Value pointer size to guess arch return c.NULL.size == 8 and "x64" or "x86" end print("C module is built for "..get_arch())