lua-users home
lua-l archive

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

> The only way right now is to use another buffer:
> buf = alien.buffer()
> buf2 = alien.buffer(4) -- for 32 bit pointers

It would be nice to have buf:address() and maybe a 'p' type for
struct.pack/unpack that would work with alien buffers directly just as
functions do oink oink :) would allow me to stick buffer pointers in
those strings as clearly as anything else.

> BTW, have you thought about using a buffer instead of struct.pack?

I use struct.pack because it emulates the structs already found in the
C headers (makes for clean documenting), and because I can fix the
byte order and alignment. But buffers are better for big mutable
arrays I guess.