mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@4eec3dc
This commit is contained in:
parent
ab8345271e
commit
1243255c3a
174 changed files with 1780 additions and 426 deletions
|
|
@ -33,6 +33,19 @@ static VALUE array_spec_RARRAY_PTR_assign(VALUE self, VALUE array, VALUE value)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
|
||||
static VALUE array_spec_RARRAY_PTR_memcpy(VALUE self, VALUE array1, VALUE array2) {
|
||||
VALUE *ptr1, *ptr2;
|
||||
int size;
|
||||
size = RARRAY_LEN(array1);
|
||||
ptr1 = RARRAY_PTR(array1);
|
||||
ptr2 = RARRAY_PTR(array2);
|
||||
if (ptr1 != NULL && ptr2 != NULL) {
|
||||
memcpy(ptr2, ptr1, size * sizeof(VALUE));
|
||||
}
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE array_spec_RARRAY_LEN(VALUE self, VALUE array) {
|
||||
return INT2FIX(RARRAY_LEN(array));
|
||||
}
|
||||
|
|
@ -229,6 +242,7 @@ void Init_array_spec(void) {
|
|||
rb_define_method(cls, "RARRAY_LEN", array_spec_RARRAY_LEN, 1);
|
||||
rb_define_method(cls, "RARRAY_PTR_iterate", array_spec_RARRAY_PTR_iterate, 1);
|
||||
rb_define_method(cls, "RARRAY_PTR_assign", array_spec_RARRAY_PTR_assign, 2);
|
||||
rb_define_method(cls, "RARRAY_PTR_memcpy", array_spec_RARRAY_PTR_memcpy, 2);
|
||||
rb_define_method(cls, "RARRAY_AREF", array_spec_RARRAY_AREF, 2);
|
||||
rb_define_method(cls, "rb_ary_aref", array_spec_rb_ary_aref, -1);
|
||||
rb_define_method(cls, "rb_ary_clear", array_spec_rb_ary_clear, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue