<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
Is it possible to allocate memory in a defined region, specifically
anywhere above the first 2GB?<br>
<br>
I see that mallocx with
<meta charset="utf-8">
ALLOCM_ALIGN allows one to specify a base address aligned to a power
of 2. Can I grab a bunch of memory that way and somehow tell an
arena to use that space and then always mallocx with that arena?<br>
<br>
I'm in the midst of writing a LuaJIT [1] binding to jemalloc, and
have successfully allocated memory aligned to 2^31 but can't figure
out the next step -- short of writing my own allocator to dole out
jemalloc-allocated memory.<br>
<br>
Context:<br>
LuaJIT, a Lua Just-In-Time compiler, can itself only allocate memory
in the lower portions of memory (<1GB, <2GB, <4GB depending
on platform). One can get around this limitation by using its FFI
to allocate memory for FFI-bound C structures, however allocating
these in the lower regions effectively "steals" available memory
from the LuaJIT VM for Lua objects. I want to ensure maximum
available memory for the LuaJIT by allocating all my objects outside
this area.<br>
<br>
Thanks,<br>
Evan<br>
<br>
[1] <a class="moz-txt-link-freetext" href="http://www.luajit.org">http://www.luajit.org</a><br>
<br>
</body>
</html>