lua-users home
lua-l archive

Re: avoiding copy - Luajit FFI

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


On Tue, Jun 7, 2011 at 10:54 AM, Fabio Kaminski <fabiokaminski@gmail.com> wrote:
> Hi Folks,
>
> Im trying to get less memory copy as possible with luajit FFI, and in
> the api to get your hands in a (void *) or (char *) pointer
> is copying it through "ffi.string()" wich in turns, will create a lua string..
>
> my first question: why cant ffi.string() reuse the given pointer.. vm
> design? avoid concurrency races  from the C side?
Because you may change the memory later on which violates the
immutability of Lua strings.
-- 
- Patrick Donnelly

AltStyle によって変換されたページ (->オリジナル) /