mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Feature #19474] Refactor NEWOBJ macros
NEWOBJ_OF is now our canonical newobj macro. It takes an optional ec
This commit is contained in:
parent
879cda98a4
commit
026321c5b9
Notes:
git
2023-04-06 10:07:41 +00:00
14 changed files with 47 additions and 52 deletions
|
@ -413,7 +413,8 @@ f_lcm(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));
|
||||
NEWOBJ_OF(obj, struct RRational, klass, T_RATIONAL | (RGENGC_WB_PROTECTED_RATIONAL ? FL_WB_PROTECTED : 0),
|
||||
sizeof(struct RRational), 0);
|
||||
|
||||
RATIONAL_SET_NUM((VALUE)obj, num);
|
||||
RATIONAL_SET_DEN((VALUE)obj, den);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue