lua-users home
lua-l archive

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


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)