Skip to content

Instantly share code, notes, and snippets.

@cablehead
Created May 7, 2016 01:38
Show Gist options
  • Save cablehead/9d0dde3e424ed5a97da901655ad2c261 to your computer and use it in GitHub Desktop.
Save cablehead/9d0dde3e424ed5a97da901655ad2c261 to your computer and use it in GitHub Desktop.
local ffi = require("ffi")
local upper = 2^48
print("UPPER:", upper)
for i = 0, upper do
if i % (10*1000*1000*1000) == 0 then
print(i)
end
local val = tonumber(ffi.cast("uintptr_t", i))
assert(ffi.cast("uintptr_t", val) == val)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment