lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 02/06/16 02:56 AM, Daurnimator wrote:
On 2 June 2016 at 04:25, Heinrich Hartmann
<heinrich@heinrichhartmann.com> wrote:
LuaJIT supports Solaris/Illumos, with the single caveat that one
cannot use lightuserdata on the stack. While LuaJIT was very
accommodating to changes required to support
Solaris/Illumos, this particular incompatibility is not something that
can be fixed easily:
LuaJIT uses pointer compaction and does not support pointers using high bits.
Illumos and its derivatives use high bits on stack memory: they are
just incompatible!

So, if lpeg wants to support Solaris/Illumus it has to avoid using
lightusedata residing the stack.

Fortunately, the problem very easy to circumvent on the application
side, by making surgical changes that are easy to reason about, as in
the PR.
I'm surprised that it works as well as you indicate.
Especially when targeting lua 5.1, pushing stack-allocated
lightuserdata is essential for safe operation (see lua_cpcall).

It sounds like you may want to send some resources towards
https://github.com/LuaJIT/LuaJIT/issues/156

LuaJIT could just go typeless. (after JIT compilation, that is)

Would be slightly slower in pure interpreted mode, but significantly faster in IL interpreted mode (which wouldn't do type checking, for the most part) and even faster in JIT compiled code. It doesn't have any drawbacks really (other than having to add another JIT mode), and it fixes all issues related to address space.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.