[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPEG on Solaris
- From: Coda Highland <chighland@...>
- Date: Wed, 1 Jun 2016 12:34:55 -0700
On Wed, Jun 1, 2016 at 12:05 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> 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 can try to avoid using lightuserdata on the stack (although that
> is a quite useful technique). However, the proposed solution does
> not seem to be the way to do it.
>
> First, it has a perceptible cost for quick matches. (In a dirty check,
> I got more than 50% of time increase for trivial matches due to the
> constant allocation/deallocation.) Second, it leaks memory in case of
> errors.
>
> -- Roberto
>
Given the performance regressions, is it reasonable to consider some
sort of platform #ifdef for the task?
As for the case of memory leakage, is it reasonable to -- on Solaris
only if possible -- use full userdata so that the GC can manage
things?
/s/ Adam