From: Jeremy Bopp Date: 2013-04-09T04:31:39+09:00 Subject: Re: Mapping string data ptr to buffer in ffi On 04/08/2013 07:41 AM, se gm wrote: >> Without >> knowing >> the usage patterns I don't think it's possible to come up with a proper >> solution. > There are many patterns including exported ones (modules and > extensions), that is why 'fixing' the logic won't work. But fixing the > bottleneck would. I would be interested to hear about any solution in this vein as well. It seems to boil down to this: can the byte buffer that backs Ruby strings be exposed for direct use by C functions? If not, then this discussion can only move on to alternatives. If it can be done, how so? Could this even be done safely without some form of cooperation from the GC? That byte buffer could potentially be moved around at any time during a GC event, couldn't it? -Jeremy