From 6538c8a18711a6eb009def36050acd5f02e42aec Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Fri, 25 Nov 2016 09:23:08 +0100 Subject: [PATCH] Document 47 bit limit for lightuserdata. --- doc/status.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/status.html b/doc/status.html index d10033b0..0acf78c9 100644 --- a/doc/status.html +++ b/doc/status.html @@ -97,6 +97,17 @@ handled correctly. The error may fall through an on-trace lua_atpanic on x64. This issue will be fixed with the new garbage collector. +
  • +LuaJIT on 64 bit systems provides a limited range of 47 bits for the +legacy lightuserdata 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 lightuserdata 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. +