diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-12-31 11:29:29 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-12-31 11:29:29 +0900 |
| commit | d95bebe06c076cdf6951b81665e2b2e779937123 (patch) | |
| tree | 4e45d84c19a3aeb304cb68cd469956f406e17c3b /include/ruby/internal | |
| parent | c352808fa9eb650ce8c1b268a348ad553df55caa (diff) | |
Make `RTYPEDDATA_EMBEDDABLE_P` internal-use only
It should not be exposed because it is so implementation specific that
it is only used in gc.c even within the entire Ruby source tree.
Diffstat (limited to 'include/ruby/internal')
| -rw-r--r-- | include/ruby/internal/core/rtypeddata.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/ruby/internal/core/rtypeddata.h b/include/ruby/internal/core/rtypeddata.h index 1dd7397f7d..505303cefa 100644 --- a/include/ruby/internal/core/rtypeddata.h +++ b/include/ruby/internal/core/rtypeddata.h @@ -548,7 +548,7 @@ RBIMPL_SYMBOL_EXPORT_END() #endif static inline bool -RTYPEDDATA_EMBEDDED_P(VALUE obj) +rbimpl_typeddata_embedded_p(VALUE obj) { #if RUBY_DEBUG if (RB_UNLIKELY(!RB_TYPE_P(obj, RUBY_T_DATA))) { @@ -560,6 +560,13 @@ RTYPEDDATA_EMBEDDED_P(VALUE obj) return (RTYPEDDATA(obj)->type) & TYPED_DATA_EMBEDDED; } +RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() +static inline bool +RTYPEDDATA_EMBEDDED_P(VALUE obj) +{ + return rbimpl_typeddata_embedded_p(obj); +} + static inline void * RTYPEDDATA_GET_DATA(VALUE obj) { @@ -571,9 +578,9 @@ RTYPEDDATA_GET_DATA(VALUE obj) #endif /* We reuse the data pointer in embedded TypedData. */ - return RTYPEDDATA_EMBEDDED_P(obj) ? - RBIMPL_CAST((void *)&(RTYPEDDATA(obj)->data)) : - RTYPEDDATA(obj)->data; + return rbimpl_typeddata_embedded_p(obj) ? + RBIMPL_CAST((void *)&RTYPEDDATA_DATA(obj)) : + RTYPEDDATA_DATA(obj); } RBIMPL_ATTR_PURE() |
