Notes
- The length operator returns the same result as the Pointer.size property.
# Pointer length operator
The length operator # applied on a Pointer object returns the size in bytes of the pointer on the current execution context, depending on the LuaRT interpreter used (x86 or x64).
Example
local c = require "c"
-- function to get current interpreter architecture (same as _ARCH global variable)
local function get_arch()
return #c.NULL == 8 and "x64" or x86
end
print("You are using the "..get_arch().." LuaRT interpreter")