Re: Any plans to increase the GC upper limit of LuaJIT on Linux x86_64?

  • From: Chris <chris@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 10 Aug 2012 09:04:31 -0400

On 08/10/2012 05:56 AM, Mike Pall wrote:
Also, the user might consider to switch from e.g. huge Lua tables
to FFI arrays and structures. If you allocate these with malloc()
and not ffi.new(), they get access to the full x64 address range.

Is that true now? In my testing I found that allocating over 4GB using malloc() caused problems on x64.

Maybe it's specific to how I was testing (a problem with os.execute?):

----------------------------------------
local ffi = require'ffi'

ffi.cdef[[
   void *malloc(size_t size);
]]

local buf = {}

for i=1,5 do
   buf[i] = ffi.C.malloc(1024*1024*1024)
   print(buf[i], buf[i] == nil)
end

print(os.execute("echo foo"))
----------------------------------------

What happens on my machine with 8GB of RAM is the os.execute() call returns -1. If the for-loop is set to only allocate 3GB then the os.execute() works normally.

--
Chris
http://luadev.com

Other related posts: