- return rb_ary_new3(3,
- rb_ary_new3(2, rb_float_new(matrix->m00), rb_float_new(matrix->m01)),
- rb_ary_new3(2, rb_float_new(matrix->m10), rb_float_new(matrix->m11)),
- rb_ary_new3(2, rb_float_new(matrix->tx), rb_float_new(matrix->ty)));
+ VALUE array = rb_ary_new2(3);
+ rb_gc_register_address(&array);
+ VALUE a = rb_ary_new2(2);
+ rb_ary_store(array, 0, a);
+ rb_ary_store(a, 0, rb_float_new(matrix->m00));
+ rb_ary_store(a, 1, rb_float_new(matrix->m01));
+ a = rb_ary_new2(2);
+ rb_ary_store(array, 1, a);
+ rb_ary_store(a, 0, rb_float_new(matrix->m10));
+ rb_ary_store(a, 1, rb_float_new(matrix->m11));
+ a = rb_ary_new2(2);
+ rb_ary_store(array, 2, a);
+ rb_ary_store(a, 0, rb_float_new(matrix->tx));
+ rb_ary_store(a, 1, rb_float_new(matrix->ty));
+ rb_gc_unregister_address(&array);
+ return array;