[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: avoiding copy - Luajit FFI
- From: Patrick Donnelly <batrick@...>
- Date: Tue, 7 Jun 2011 11:02:49 -0400
On Tue, Jun 7, 2011 at 10:54 AM, Fabio Kaminski <firstname.lastname@example.org> 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