lua-users home
lua-l archive

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


On 2 June 2011 10:56, Florian Weimer <fw@deneb.enyo.de> wrote:
> I'm interested in defining a lightweight library for mutable byte
> arrays.  I'm attaching a draft.

Have you taken a look at memarray?

https://github.com/LuaDist/luaglut/blob/master/memarray.c

It's a little more complex because it handles different types of
numeric arrays as well (including endianness issues through tonetstr,
fromnetstr.

Just one other note, in
-- src byte array, dst string, spos, dpos, len integers
bytes.copy(dst, dpos, src, spos, len)
You probably meant to switch src and dst in the comment line.

    henk