From: Tim Hunter Date: 2008-02-07T02:46:06+09:00 Subject: Re: Avoiding memcpy() during String creation in a C extensio Wincent Colaiuta wrote: > > Basically what I would like is a String instantiation method which > could take a pointer to a buffer and basically take ownership of that > buffer instead of calling memcpy() on it. > > I've looked in string.c to see if such a function exists and it > appears that it does not. Instead of putting your data into a buffer and then asking Ruby to make a String out of it, could you use rb_str_buf_new() to create a String with a specific capacity and then put your data into the String's buffer? -- Posted via http://www.ruby-forum.com/.