gc.c: use RUBY_DEFAULT_FREE instead of open-coded constant

Improves readability and makes future changes easier

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-05-22 01:42:21 +00:00
parent 0a4be5beda
commit 2be65894e1

2
gc.c
View File

@ -2978,7 +2978,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
if (RTYPEDDATA_P(p)) { if (RTYPEDDATA_P(p)) {
RDATA(p)->dfree = RANY(p)->as.typeddata.type->function.dfree; RDATA(p)->dfree = RANY(p)->as.typeddata.type->function.dfree;
} }
if (RANY(p)->as.data.dfree == (RUBY_DATA_FUNC)-1) { if (RANY(p)->as.data.dfree == RUBY_DEFAULT_FREE) {
xfree(DATA_PTR(p)); xfree(DATA_PTR(p));
} }
else if (RANY(p)->as.data.dfree) { else if (RANY(p)->as.data.dfree) {