Document 47 bit limit for lightuserdata.

This commit is contained in:
Mike Pall 2016-11-25 09:23:08 +01:00
parent d7243e1de0
commit 6538c8a187

View File

@ -97,6 +97,17 @@ handled correctly. The error may fall through an on-trace
<tt>lua_atpanic</tt> on x64. This issue will be fixed with the new <tt>lua_atpanic</tt> on x64. This issue will be fixed with the new
garbage collector. garbage collector.
</li> </li>
<li>
LuaJIT on 64 bit systems provides a <b>limited range</b> of 47 bits for the
<b>legacy <tt>lightuserdata</tt></b> data type.
This is only relevant on x64 systems which use the negative part of the
virtual address space in user mode, e.g. Solaris/x64, and on ARM64 systems
configured with a 48 bit or 52 bit VA.
Avoid using <tt>lightuserdata</tt> to hold pointers that may point outside
of that range, e.g. variables on the stack. In general, avoid this data
type for new code and replace it with (much more performant) FFI bindings.
FFI cdata pointers can address the full 64 bit range.
</li>
</ul> </ul>
<br class="flush"> <br class="flush">
</div> </div>