[Ruby] splatting arguments in a C extension
Aaron Patterson
aaron at tenderlovemaking.com
Sat Feb 2 12:49:48 PST 2008
On Sat, Feb 02, 2008 at 12:06:13PM -0800, John Barnette wrote:
> > On Feb 2, 2008, at 1:09 AM, Ryan Davis wrote:
> > I am teh awesome: <snip>
>
> On Feb 2, 2008 9:04 AM, Evan Phoenix <evan at fallingsnow.net> wrote:
> > No, not GC friendly. That memory will remain allocated forever. <snip>
>
> Let's just cast, then:
>
> VALUE rb_funcall_splat(VALUE receiver, ID method, VALUE argv)
> {
> return rb_funcall2(receiver, method, RARRAY_LEN(argv), RARRAY_PTR(argv));
> }
Ah. That seems to work. This should be gc friendly as well. Right?
--
Aaron Patterson
http://tenderlovemaking.com/
More information about the Ruby
mailing list