Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using NEWOBJ_OF #33

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ext/enumerable/statistics/extension/statistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ complex_new(VALUE klass, VALUE real, VALUE imag)
{
assert(!RB_TYPE_P(real, T_COMPLEX));

NEWOBJ_OF(obj, struct RComplex, klass, T_COMPLEX | (RGENGC_WB_PROTECTED_COMPLEX ? FL_WB_PROTECTED : 0));
VALUE obj = rb_get_alloc_func(klass)(klass);

RCOMPLEX_SET_REAL(obj, real);
RCOMPLEX_SET_IMAG(obj, imag);
Expand Down Expand Up @@ -538,9 +538,11 @@ f_gcd(VALUE x, VALUE y)
inline static VALUE
nurat_s_new_internal(VALUE klass, VALUE num, VALUE den)
{
NEWOBJ_OF(obj, struct RRational, klass, T_RATIONAL | (RGENGC_WB_PROTECTED_RATIONAL ? FL_WB_PROTECTED : 0));
VALUE obj = rb_get_alloc_func(klass)(klass);

RRATIONAL_SET_NUM(obj, num);
RRATIONAL_SET_DEN(obj, den);

return (VALUE)obj;
}

Expand Down
Loading