lua-users home
lua-l archive

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


On Sat, Aug 23, 2014 at 12:59 AM, Coroutines <coroutines@gmail.com> wrote:
> So then you know what a pain it is to not be able to represent a
> simple ring buffer, or provide DMA access to the NIC's ring buffer
> hosted through userdata to Lua


hey, i do that!

using LuaJIT's FFI, of course, which isn't exactly userdata... but
when i've used any buffer-like userdata object, it's trivially easy to
add a :substr([i,[j]]) method and a :setslice(s[,i[,j]]) too, if i
want it to be mutable.  the [,j] optional argument only goes there if
it's legal to shift content around, obviously.

-- 
Javier