ext/fiddle/memory_view.c in fiddle-1.0.5 vs ext/fiddle/memory_view.c in fiddle-1.0.6

- old
+ new

@@ -46,11 +46,11 @@ static size_t fiddle_memview_memsize(const void *ptr) { const struct memview_data *data = ptr; - return sizeof(*data) + sizeof(rb_memory_view_item_component_t)*data->n_members + (size_t)data->view.len; + return sizeof(*data) + sizeof(rb_memory_view_item_component_t)*data->n_members + (size_t)data->view.byte_size; } static const rb_data_type_t fiddle_memview_data_type = { "fiddle/memory_view", {fiddle_memview_mark, fiddle_memview_free, fiddle_memview_memsize,}, @@ -88,17 +88,17 @@ return data->view.obj; } static VALUE -rb_fiddle_memview_get_length(VALUE obj) +rb_fiddle_memview_get_byte_size(VALUE obj) { struct memview_data *data; TypedData_Get_Struct(obj, struct memview_data, &fiddle_memview_data_type, data); if (NIL_P(data->view.obj)) return Qnil; - return SSIZET2NUM(data->view.len); + return SSIZET2NUM(data->view.byte_size); } static VALUE rb_fiddle_memview_get_readonly(VALUE obj) { @@ -238,10 +238,10 @@ { rb_cMemoryView = rb_define_class_under(mFiddle, "MemoryView", rb_cObject); rb_define_alloc_func(rb_cMemoryView, rb_fiddle_memview_s_allocate); rb_define_method(rb_cMemoryView, "initialize", rb_fiddle_memview_initialize, 1); rb_define_method(rb_cMemoryView, "obj", rb_fiddle_memview_get_obj, 0); - rb_define_method(rb_cMemoryView, "length", rb_fiddle_memview_get_length, 0); + rb_define_method(rb_cMemoryView, "byte_size", rb_fiddle_memview_get_byte_size, 0); rb_define_method(rb_cMemoryView, "readonly?", rb_fiddle_memview_get_readonly, 0); rb_define_method(rb_cMemoryView, "format", rb_fiddle_memview_get_format, 0); rb_define_method(rb_cMemoryView, "item_size", rb_fiddle_memview_get_item_size, 0); rb_define_method(rb_cMemoryView, "ndim", rb_fiddle_memview_get_ndim, 0); rb_define_method(rb_cMemoryView, "shape", rb_fiddle_memview_get_shape, 0);