From: Robert Klemme Date: 2013-04-09T15:52:25+09:00 Subject: Re: Mapping string data ptr to buffer in ffi --f46d04478903be596f04d9e7fe0b Content-Type: text/plain; charset=ISO-8859-1 On Tue, Apr 9, 2013 at 7:46 AM, Carlo E. Prelz wrote: > Subject: Re: Mapping string data ptr to buffer in ffi > Date: mar 09 apr 13 05:27:43 +0900 > > Quoting Jeremy Bopp (jeremy@bopp.net): > > In my case at least, all operations on the buffer would only change > > content within the existing buffer. The size of the string that owns > > the buffer would be unaffected. I think the OP has similar needs from > > the sound of it. > > The OP had quite different needs, if I got this correctly. I think he wanted exactly that as well - although he never explicitly stated whether resizing would be necessary. > He wanted > huge amounts of strings to be accessible read-only from some form of > global memory, and he hoped he could introduce them into the Ruby > environment without paying the price of creating String objects (and > thus without needing to duplicate the memory needs, and without > incurring the performance hit of allocation/deallocation). > ... and apparently also without proper synchronization. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --f46d04478903be596f04d9e7fe0b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= On Tue, Apr 9, 2013 at 7:46 AM, Carlo E. Prelz <fluido@fluido.as> wrote:
=A0 =A0 =A0 =A0 Subject: R= e: Mapping string data ptr to buffer in ffi
=A0 =A0 =A0 =A0 Date: mar 09 apr 13 05:27:43 +0900

Quoting Jeremy Bopp (jeremy@bopp.net= ):
> In my case at least, all operations on the buffer would only change > content within the existing buffer. =A0The size of the string that own= s
> the buffer would be unaffected. =A0I think the OP has similar needs fr= om
> the sound of it.
=A0
The OP had quite different needs, if I got this correctly.

I think he wanted exactly that as well - although= he never explicitly stated whether resizing would be necessary.
= =A0
He wanted
huge amounts of strings to be accessible read-only from some form of
global memory, and he hoped he could introduce them into the Ruby
environment without paying the price of creating String objects (and
thus without needing to duplicate the memory needs, and without
incurring the performance hit of allocation/deallocation).
=

... and apparently also without proper synchronization.

Cheers

robert

--
remember.guy = do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
--f46d04478903be596f04d9e7fe0b--