diff --git a/struct.c b/struct.c index f0307916b3..17e53ab4e0 100644 --- a/struct.c +++ b/struct.c @@ -429,6 +429,9 @@ rb_struct_new(VALUE klass, ...) return rb_class_new_instance(size, mem, klass); } +static VALUE +rb_struct_size(VALUE s); + /* * call-seq: * struct.each {|obj| block } -> struct @@ -455,7 +458,7 @@ rb_struct_each(VALUE s) { long i; - RETURN_ENUMERATOR(s, 0, 0); + RETURN_SIZED_ENUMERATOR(s, 0, 0, rb_struct_size); for (i=0; i