[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luajit: any way to make array initialization zero-based?
- From: Geoff Leyland <geoff_leyland@...>
- Date: Thu, 14 Jun 2012 11:16:38 +1200
On 14/06/2012, at 10:07 AM, Chris wrote:
> Forcing the FFI types to
> use one-based indexing doesn't work either when that data needs to go
> to a native API (eg. OpenGL vertex data or something; it can be faked
> but you take a serious performance hit).
Have you considered allocating your FFI arrays to be one longer than they need to be, and then remembering to offset the pointer to the array by one when you pass it to external C functions. Not exactly pretty, I know, but perhaps less worse than some alternatives.
(Also, LuaJIT has its own mailing list now: http://luajit.org/list.html)