Pointer.size readonly



The Pointer.size property gets the size in bytes of a C pointer on the current execution context, depending on the LuaRT interpreter used (x86 or x64).

Notes

  • The Lua length operator # can be used to retrieve the size too.

Example

local c = require "c" -- function to get current interpreter architecture (same as _ARCH global variable) local function get_arch() return c.NULL.size == 8 and "x64" or x86 end print("You are using the "..get_arch().." LuaRT interpreter")