method
initialize_copy
initialize_copy(p1)
public
Hide source
static VALUE rb_stat_init_copy(VALUE copy, VALUE orig) { struct stat *nst; if (copy == orig) return orig; rb_check_frozen(copy); /* need better argument type check */ if (!rb_obj_is_instance_of(orig, rb_obj_class(copy))) { rb_raise(rb_eTypeError, "wrong argument class"); } if (DATA_PTR(copy)) { xfree(DATA_PTR(copy)); DATA_PTR(copy) = 0; } if (DATA_PTR(orig)) { nst = ALLOC(struct stat); *nst = *(struct stat*)DATA_PTR(orig); DATA_PTR(copy) = nst; } return copy; }