fix compile error w/ -DUSE_TRANSIENT_HEAP=0

rb_transient_heap_managed_ptr_p is available only when USE_TRANSIENT_HEAP.
Need #if guards.
This commit is contained in:
卜部昌平 2020-02-25 12:42:00 +09:00
parent 97fa6468dc
commit 2325017477
2 changed files with 4 additions and 0 deletions

View File

@ -216,9 +216,11 @@ ary_verify_(VALUE ary, const char *file, int line)
#endif #endif
} }
#if USE_TRANSIENT_HEAP
if (RARRAY_TRANSIENT_P(ary)) { if (RARRAY_TRANSIENT_P(ary)) {
assert(rb_transient_heap_managed_ptr_p(RARRAY_CONST_PTR_TRANSIENT(ary))); assert(rb_transient_heap_managed_ptr_p(RARRAY_CONST_PTR_TRANSIENT(ary)));
} }
#endif
rb_transient_heap_verify(); rb_transient_heap_verify();

2
hash.c
View File

@ -528,11 +528,13 @@ hash_verify_(VALUE hash, const char *file, int line)
HASH_ASSERT(RHASH_AR_TABLE_BOUND_RAW(hash) == 0); HASH_ASSERT(RHASH_AR_TABLE_BOUND_RAW(hash) == 0);
} }
#if USE_TRANSIENT_HEP
if (RHASH_TRANSIENT_P(hash)) { if (RHASH_TRANSIENT_P(hash)) {
volatile st_data_t MAYBE_UNUSED(key) = RHASH_AR_TABLE_REF(hash, 0)->key; /* read */ volatile st_data_t MAYBE_UNUSED(key) = RHASH_AR_TABLE_REF(hash, 0)->key; /* read */
HASH_ASSERT(RHASH_AR_TABLE(hash) != NULL); HASH_ASSERT(RHASH_AR_TABLE(hash) != NULL);
HASH_ASSERT(rb_transient_heap_managed_ptr_p(RHASH_AR_TABLE(hash))); HASH_ASSERT(rb_transient_heap_managed_ptr_p(RHASH_AR_TABLE(hash)));
} }
#endif
return hash; return hash;
} }