Discussion:
Sysmalloc on OSX 64-bit
Dan Nilsson
2014-10-20 15:41:06 UTC
Permalink
Hi all,

I have a mad plan of calling into LuaJIT through Java native calls on OSX
64bit (ultimately to transform lua source into bytecode). It seems like it
should be doable, but I have encountered a problem:

Luajit on OSX 64-bit says to link with:
-pagezero_size 10000 -image_base 100000000

I will have no control over that (as executable will be a java
application), so I figured I could just use sysmalloc in this case and not
rely on luajitĀ¹s own allocator.

=> #error "Must use builtin allocator for 64 bit target

Would it be asking for trouble to just ignore this and remove the #error
so I can build it with sysmalloc anyway?

What is the reason for this requirement?

Any help would be appreciated,

Thanks!
Dan
Karel Tuma
2014-10-20 17:32:15 UTC
Permalink
Post by Dan Nilsson
-pagezero_size 10000 -image_base 100000000
munmap(0,1LL<<32) (this is the default, figure out __PAGEZERO
at runtime to make it robust).
Post by Dan Nilsson
=> #error "Must use builtin allocator for 64 bit target
Would it be asking for trouble to just ignore this and remove the #error
so I can build it with sysmalloc anyway?
Don't.
Post by Dan Nilsson
What is the reason for this requirement?
Pointers must fit 32 bits, and speed.

K.

Loading...