Ruby: include/ruby/internal/fl_type.h Source File

Ruby 4.0.6p0 (2026-07-14 revision 03b6d3f8898a28604fe6cb00eae3226b821168f4)

fl_type.h
Go to the documentation of this file.
1#ifndef RBIMPL_FL_TYPE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_FL_TYPE_H
23#include "ruby/internal/config.h" /* for ENUM_OVER_INT */
24#include "ruby/internal/attr/artificial.h"
25#include "ruby/internal/attr/deprecated.h"
26#include "ruby/internal/attr/flag_enum.h"
27#include "ruby/internal/attr/forceinline.h"
28#include "ruby/internal/attr/noalias.h"
29#include "ruby/internal/attr/pure.h"
30#include "ruby/internal/cast.h"
31#include "ruby/internal/compiler_since.h"
32#include "ruby/internal/core/rbasic.h"
33#include "ruby/internal/dllexport.h"
34#include "ruby/internal/has/extension.h"
35#include "ruby/internal/special_consts.h"
36#include "ruby/internal/stdbool.h"
37#include "ruby/internal/value.h"
38#include "ruby/internal/value_type.h"
39#include "ruby/assert.h"
40#include "ruby/defines.h"
41
43#if RBIMPL_HAS_EXTENSION(enumerator_attributes)
44# define RBIMPL_HAVE_ENUM_ATTRIBUTE 1
45#elif RBIMPL_COMPILER_SINCE(GCC, 6, 0, 0)
46# define RBIMPL_HAVE_ENUM_ATTRIBUTE 1
47#endif
48
49#ifdef ENUM_OVER_INT
50# define RBIMPL_WIDER_ENUM 1
51#elif SIZEOF_INT * CHAR_BIT > 12+19+1
52# define RBIMPL_WIDER_ENUM 1
53#else
54# define RBIMPL_WIDER_ENUM 0
55#endif
57
58#define FL_SINGLETON RBIMPL_CAST((VALUE)RUBY_FL_SINGLETON)
59#define FL_WB_PROTECTED RBIMPL_CAST((VALUE)RUBY_FL_WB_PROTECTED)
60#define FL_PROMOTED RBIMPL_CAST((VALUE)RUBY_FL_PROMOTED)
61#define FL_FINALIZE RBIMPL_CAST((VALUE)RUBY_FL_FINALIZE)
62#define FL_TAINT RBIMPL_CAST((VALUE)RUBY_FL_TAINT)
63#define FL_SHAREABLE RBIMPL_CAST((VALUE)RUBY_FL_SHAREABLE)
64#define FL_UNTRUSTED RBIMPL_CAST((VALUE)RUBY_FL_UNTRUSTED)
65#define FL_EXIVAR RBIMPL_CAST((VALUE)RUBY_FL_EXIVAR)
66#define FL_FREEZE RBIMPL_CAST((VALUE)RUBY_FL_FREEZE)
67
68#define FL_USHIFT RBIMPL_CAST((VALUE)RUBY_FL_USHIFT)
69
70#define FL_USER0 RBIMPL_CAST((VALUE)RUBY_FL_USER0)
71#define FL_USER1 RBIMPL_CAST((VALUE)RUBY_FL_USER1)
72#define FL_USER2 RBIMPL_CAST((VALUE)RUBY_FL_USER2)
73#define FL_USER3 RBIMPL_CAST((VALUE)RUBY_FL_USER3)
74#define FL_USER4 RBIMPL_CAST((VALUE)RUBY_FL_USER4)
75#define FL_USER5 RBIMPL_CAST((VALUE)RUBY_FL_USER5)
76#define FL_USER6 RBIMPL_CAST((VALUE)RUBY_FL_USER6)
77#define FL_USER7 RBIMPL_CAST((VALUE)RUBY_FL_USER7)
78#define FL_USER8 RBIMPL_CAST((VALUE)RUBY_FL_USER8)
79#define FL_USER9 RBIMPL_CAST((VALUE)RUBY_FL_USER9)
80#define FL_USER10 RBIMPL_CAST((VALUE)RUBY_FL_USER10)
81#define FL_USER11 RBIMPL_CAST((VALUE)RUBY_FL_USER11)
82#define FL_USER12 RBIMPL_CAST((VALUE)RUBY_FL_USER12)
83#define FL_USER13 RBIMPL_CAST((VALUE)RUBY_FL_USER13)
84#define FL_USER14 RBIMPL_CAST((VALUE)RUBY_FL_USER14)
85#define FL_USER15 RBIMPL_CAST((VALUE)RUBY_FL_USER15)
86#define FL_USER16 RBIMPL_CAST((VALUE)RUBY_FL_USER16)
87#define FL_USER17 RBIMPL_CAST((VALUE)RUBY_FL_USER17)
88#define FL_USER18 RBIMPL_CAST((VALUE)RUBY_FL_USER18)
89#define FL_USER19 RBIMPL_CAST((VALUE)(unsigned int)RUBY_FL_USER19)
90
91#define ELTS_SHARED RUBY_ELTS_SHARED
92#define RB_OBJ_FREEZE rb_obj_freeze_inline
93
95#define RUBY_ELTS_SHARED RUBY_ELTS_SHARED
96#define RB_FL_ABLE RB_FL_ABLE
97#define RB_FL_ALL RB_FL_ALL
98#define RB_FL_ALL_RAW RB_FL_ALL_RAW
99#define RB_FL_ANY RB_FL_ANY
100#define RB_FL_ANY_RAW RB_FL_ANY_RAW
101#define RB_FL_REVERSE RB_FL_REVERSE
102#define RB_FL_REVERSE_RAW RB_FL_REVERSE_RAW
103#define RB_FL_SET RB_FL_SET
104#define RB_FL_SET_RAW RB_FL_SET_RAW
105#define RB_FL_TEST RB_FL_TEST
106#define RB_FL_TEST_RAW RB_FL_TEST_RAW
107#define RB_FL_UNSET RB_FL_UNSET
108#define RB_FL_UNSET_RAW RB_FL_UNSET_RAW
109#define RB_OBJ_FREEZE_RAW RB_OBJ_FREEZE_RAW
110#define RB_OBJ_FROZEN RB_OBJ_FROZEN
111#define RB_OBJ_FROZEN_RAW RB_OBJ_FROZEN_RAW
112#define RB_OBJ_UNTRUST RB_OBJ_TAINT
113#define RB_OBJ_UNTRUSTED RB_OBJ_TAINTED
115
121#define FL_ABLE RB_FL_ABLE
122#define FL_ALL RB_FL_ALL
123#define FL_ALL_RAW RB_FL_ALL_RAW
124#define FL_ANY RB_FL_ANY
125#define FL_ANY_RAW RB_FL_ANY_RAW
126#define FL_REVERSE RB_FL_REVERSE
127#define FL_REVERSE_RAW RB_FL_REVERSE_RAW
128#define FL_SET RB_FL_SET
129#define FL_SET_RAW RB_FL_SET_RAW
130#define FL_TEST RB_FL_TEST
131#define FL_TEST_RAW RB_FL_TEST_RAW
132#define FL_UNSET RB_FL_UNSET
133#define FL_UNSET_RAW RB_FL_UNSET_RAW
134#define OBJ_FREEZE RB_OBJ_FREEZE
135#define OBJ_FREEZE_RAW RB_OBJ_FREEZE_RAW
136#define OBJ_FROZEN RB_OBJ_FROZEN
137#define OBJ_FROZEN_RAW RB_OBJ_FROZEN_RAW
138#define OBJ_INFECT RB_OBJ_INFECT
139#define OBJ_INFECT_RAW RB_OBJ_INFECT_RAW
140#define OBJ_TAINT RB_OBJ_TAINT
141#define OBJ_TAINTABLE RB_OBJ_TAINTABLE
142#define OBJ_TAINTED RB_OBJ_TAINTED
143#define OBJ_TAINTED_RAW RB_OBJ_TAINTED_RAW
144#define OBJ_TAINT_RAW RB_OBJ_TAINT_RAW
145#define OBJ_UNTRUST RB_OBJ_UNTRUST
146#define OBJ_UNTRUSTED RB_OBJ_UNTRUSTED
148
153 enum ruby_fl_ushift {
158 RUBY_FL_USHIFT = 12
159};
160
161/* > The expression that defines the value of an enumeration constant shall be
162 * > an integer constant expression that has a value representable as an `int`.
163 *
164 * -- ISO/IEC 9899:2018 section 6.7.2.2
165 *
166 * So ENUM_OVER_INT situation is an extension to the standard. Note however
167 * that we do not support 16 bit `int` environment. */
168 RB_GNUC_EXTENSION
182 enum
183 RBIMPL_ATTR_FLAG_ENUM()
184 ruby_fl_type {
185
198 RUBY_FL_WB_PROTECTED = (1<<5),
199
217 RUBY_FL_PROMOTED = (1<<5),
218
224 RUBY_FL_USERPRIV0 = (1<<6),
225
238 RUBY_FL_FINALIZE = (1<<7),
239
245 RUBY_FL_TAINT
246
247#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
248 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
249#elif defined(_MSC_VER)
250# pragma deprecated(RUBY_FL_TAINT)
251#endif
252
253 = 0,
254
260 RUBY_FL_EXIVAR
261
262#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
263 RBIMPL_ATTR_DEPRECATED(("FL_EXIVAR is an outdated implementation detail, it should not be used."))
264#elif defined(_MSC_VER)
265# pragma deprecated(RUBY_FL_EXIVAR)
266#endif
267
268 = 0,
269
280 RUBY_FL_SHAREABLE = (1<<8),
281
287 RUBY_FL_UNTRUSTED
288
289#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
290 RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
291#elif defined(_MSC_VER)
292# pragma deprecated(RUBY_FL_UNTRUSTED)
293#endif
294
295 = 0,
296
302 RUBY_FL_UNUSED9 = (1<<9),
303
309 RUBY_FL_UNUSED10 = (1<<10),
310
320 RUBY_FL_FREEZE = (1<<11),
321
323#define RBIMPL_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
324 RBIMPL_FL_USER_N(0),
325 RBIMPL_FL_USER_N(1),
326 RBIMPL_FL_USER_N(2),
327 RBIMPL_FL_USER_N(3),
328 RBIMPL_FL_USER_N(4),
329 RBIMPL_FL_USER_N(5),
330 RBIMPL_FL_USER_N(6),
331 RBIMPL_FL_USER_N(7),
332 RBIMPL_FL_USER_N(8),
333 RBIMPL_FL_USER_N(9),
334 RBIMPL_FL_USER_N(10),
335 RBIMPL_FL_USER_N(11),
336 RBIMPL_FL_USER_N(12),
337 RBIMPL_FL_USER_N(13),
338 RBIMPL_FL_USER_N(14),
339 RBIMPL_FL_USER_N(15),
340 RBIMPL_FL_USER_N(16),
341 RBIMPL_FL_USER_N(17),
342 RBIMPL_FL_USER_N(18),
343#ifdef ENUM_OVER_INT
344 RBIMPL_FL_USER_N(19),
345#else
346# define RUBY_FL_USER19 (RBIMPL_VALUE_ONE<<(RUBY_FL_USHIFT+19))
347#endif
348#undef RBIMPL_FL_USER_N
349#undef RBIMPL_WIDER_ENUM
350
369 RUBY_ELTS_SHARED = RUBY_FL_USER0,
370
394 RUBY_FL_SINGLETON = RUBY_FL_USER1,
395};
396
397enum {
403 RUBY_FL_DUPPED
404
405#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
406 RBIMPL_ATTR_DEPRECATED(("It seems there is no actual usage of this enum."))
407#elif defined(_MSC_VER)
408# pragma deprecated(RUBY_FL_DUPPED)
409#endif
410
411 = (int)RUBY_T_MASK
412};
413
414#undef RBIMPL_HAVE_ENUM_ATTRIBUTE
415
416 RBIMPL_SYMBOL_EXPORT_BEGIN()
424void rb_freeze_singleton_class(VALUE klass);
425 RBIMPL_SYMBOL_EXPORT_END()
426
427 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
428 RBIMPL_ATTR_ARTIFICIAL()
429 RBIMPL_ATTR_FORCEINLINE()
439static bool
440RB_FL_ABLE(VALUE obj)
441{
442 if (RB_SPECIAL_CONST_P(obj)) {
443 return false;
444 }
445 else {
446 RBIMPL_ASSERT_OR_ASSUME(!RB_TYPE_P(obj, RUBY_T_NODE));
447 return true;
448 }
449}
450
451 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
452 RBIMPL_ATTR_ARTIFICIAL()
462static inline VALUE
463RB_FL_TEST_RAW(VALUE obj, VALUE flags)
464{
465 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
466 return RBASIC(obj)->flags & flags;
467}
468
469 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
470 RBIMPL_ATTR_ARTIFICIAL()
488static inline VALUE
489RB_FL_TEST(VALUE obj, VALUE flags)
490{
491 if (RB_FL_ABLE(obj)) {
492 return RB_FL_TEST_RAW(obj, flags);
493 }
494 else {
495 return RBIMPL_VALUE_NULL;
496 }
497}
498
499 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
500 RBIMPL_ATTR_ARTIFICIAL()
511static inline bool
512RB_FL_ANY_RAW(VALUE obj, VALUE flags)
513{
514 return RB_FL_TEST_RAW(obj, flags);
515}
516
517 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
518 RBIMPL_ATTR_ARTIFICIAL()
527static inline bool
528RB_FL_ANY(VALUE obj, VALUE flags)
529{
530 return RB_FL_TEST(obj, flags);
531}
532
533 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
534 RBIMPL_ATTR_ARTIFICIAL()
545static inline bool
546RB_FL_ALL_RAW(VALUE obj, VALUE flags)
547{
548 return RB_FL_TEST_RAW(obj, flags) == flags;
549}
550
551 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
552 RBIMPL_ATTR_ARTIFICIAL()
561static inline bool
562RB_FL_ALL(VALUE obj, VALUE flags)
563{
564 return RB_FL_TEST(obj, flags) == flags;
565}
566
567 RBIMPL_ATTR_NOALIAS()
568 RBIMPL_ATTR_ARTIFICIAL()
584static inline void
585rbimpl_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
586{
587 obj->flags |= flags;
588}
589
590 RBIMPL_ATTR_ARTIFICIAL()
599static inline void
600RB_FL_SET_RAW(VALUE obj, VALUE flags)
601{
602 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
603 rbimpl_fl_set_raw_raw(RBASIC(obj), flags);
604}
605
606 RBIMPL_ATTR_ARTIFICIAL()
619static inline void
620RB_FL_SET(VALUE obj, VALUE flags)
621{
622 if (RB_FL_ABLE(obj)) {
623 RB_FL_SET_RAW(obj, flags);
624 }
625}
626
627 RBIMPL_ATTR_NOALIAS()
628 RBIMPL_ATTR_ARTIFICIAL()
644static inline void
645rbimpl_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
646{
647 obj->flags &= ~flags;
648}
649
650 RBIMPL_ATTR_ARTIFICIAL()
659static inline void
660RB_FL_UNSET_RAW(VALUE obj, VALUE flags)
661{
662 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
663 rbimpl_fl_unset_raw_raw(RBASIC(obj), flags);
664}
665
666 RBIMPL_ATTR_ARTIFICIAL()
674static inline void
675RB_FL_UNSET(VALUE obj, VALUE flags)
676{
677 if (RB_FL_ABLE(obj)) {
678 RB_FL_UNSET_RAW(obj, flags);
679 }
680}
681
682 RBIMPL_ATTR_NOALIAS()
683 RBIMPL_ATTR_ARTIFICIAL()
699static inline void
700rbimpl_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
701{
702 obj->flags ^= flags;
703}
704
705 RBIMPL_ATTR_ARTIFICIAL()
714static inline void
715RB_FL_REVERSE_RAW(VALUE obj, VALUE flags)
716{
717 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
718 rbimpl_fl_reverse_raw_raw(RBASIC(obj), flags);
719}
720
721 RBIMPL_ATTR_ARTIFICIAL()
730static inline void
731RB_FL_REVERSE(VALUE obj, VALUE flags)
732{
733 if (RB_FL_ABLE(obj)) {
734 RB_FL_REVERSE_RAW(obj, flags);
735 }
736}
737
738 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
739 RBIMPL_ATTR_ARTIFICIAL()
740 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
749static inline bool
750RB_OBJ_TAINTABLE(VALUE obj)
751{
752 (void)obj;
753 return false;
754}
755
756 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
757 RBIMPL_ATTR_ARTIFICIAL()
758 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
767static inline VALUE
768RB_OBJ_TAINTED_RAW(VALUE obj)
769{
770 (void)obj;
771 return false;
772}
773
774 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
775 RBIMPL_ATTR_ARTIFICIAL()
776 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
785static inline bool
786RB_OBJ_TAINTED(VALUE obj)
787{
788 (void)obj;
789 return false;
790}
791
792 RBIMPL_ATTR_ARTIFICIAL()
793 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
801static inline void
802RB_OBJ_TAINT_RAW(VALUE obj)
803{
804 (void)obj;
805 return;
806}
807
808 RBIMPL_ATTR_ARTIFICIAL()
809 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
817static inline void
818RB_OBJ_TAINT(VALUE obj)
819{
820 (void)obj;
821 return;
822}
823
824 RBIMPL_ATTR_ARTIFICIAL()
825 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
834static inline void
835RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
836{
837 (void)dst;
838 (void)src;
839 return;
840}
841
842 RBIMPL_ATTR_ARTIFICIAL()
843 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
852static inline void
853RB_OBJ_INFECT(VALUE dst, VALUE src)
854{
855 (void)dst;
856 (void)src;
857 return;
858}
859
860 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
861 RBIMPL_ATTR_ARTIFICIAL()
876static inline VALUE
877RB_OBJ_FROZEN_RAW(VALUE obj)
878{
879 return RB_FL_TEST_RAW(obj, RUBY_FL_FREEZE);
880}
881
882 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
883 RBIMPL_ATTR_ARTIFICIAL()
891static inline bool
892RB_OBJ_FROZEN(VALUE obj)
893{
894 if (! RB_FL_ABLE(obj)) {
895 return true;
896 }
897 else {
898 return RB_OBJ_FROZEN_RAW(obj);
899 }
900}
901
902RUBY_SYMBOL_EXPORT_BEGIN
911void rb_obj_freeze_inline(VALUE obj);
912RUBY_SYMBOL_EXPORT_END
913
914 RBIMPL_ATTR_ARTIFICIAL()
921static inline void
922RB_OBJ_FREEZE_RAW(VALUE obj)
923{
924 rb_obj_freeze_inline(obj);
925}
926
927#endif /* RBIMPL_FL_TYPE_H */
artificial.h
Defines RBIMPL_ATTR_ARTIFICIAL.
RBIMPL_ATTR_ARTIFICIAL
#define RBIMPL_ATTR_ARTIFICIAL()
Wraps (or simulates) __attribute__((artificial)).
Definition artificial.h:43
assert.h
RBIMPL_ASSERT_OR_ASSUME
#define RBIMPL_ASSERT_OR_ASSUME(...)
This is either RUBY_ASSERT or RBIMPL_ASSUME, depending on RUBY_DEBUG.
Definition assert.h:311
compiler_since.h
Defines RBIMPL_COMPILER_SINCE.
deprecated.h
Defines RBIMPL_ATTR_DEPRECATED.
RBIMPL_ATTR_DEPRECATED
#define RBIMPL_ATTR_DEPRECATED(msg)
Wraps (or simulates) [[deprecated]].
Definition deprecated.h:64
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
RUBY_FL_DUPPED
@ RUBY_FL_DUPPED
Definition fl_type.h:403
ruby_fl_ushift
ruby_fl_ushift
This is an enum because GDB wants it (rather than a macro).
Definition fl_type.h:153
RUBY_FL_USHIFT
@ RUBY_FL_USHIFT
Number of bits in ruby_fl_type that are not open to users.
Definition fl_type.h:158
RB_OBJ_FROZEN_RAW
static VALUE RB_OBJ_FROZEN_RAW(VALUE obj)
This is an implementation detail of RB_OBJ_FROZEN().
Definition fl_type.h:877
RB_OBJ_TAINTABLE
static bool RB_OBJ_TAINTABLE(VALUE obj)
Definition fl_type.h:750
RB_FL_TEST
static VALUE RB_FL_TEST(VALUE obj, VALUE flags)
Tests if the given flag(s) are set or not.
Definition fl_type.h:489
RB_FL_TEST_RAW
static VALUE RB_FL_TEST_RAW(VALUE obj, VALUE flags)
This is an implementation detail of RB_FL_TEST().
Definition fl_type.h:463
RB_FL_ABLE
static bool RB_FL_ABLE(VALUE obj)
Checks if the object is flaggable.
Definition fl_type.h:440
RB_FL_ANY_RAW
static bool RB_FL_ANY_RAW(VALUE obj, VALUE flags)
This is an implementation detail of RB_FL_ANY().
Definition fl_type.h:512
RB_FL_ANY
static bool RB_FL_ANY(VALUE obj, VALUE flags)
Identical to RB_FL_TEST(), except it returns bool.
Definition fl_type.h:528
RB_FL_SET_RAW
static void RB_FL_SET_RAW(VALUE obj, VALUE flags)
This is an implementation detail of RB_FL_SET().
Definition fl_type.h:600
RB_FL_ALL
static bool RB_FL_ALL(VALUE obj, VALUE flags)
Identical to RB_FL_ANY(), except it mandates all passed flags be set.
Definition fl_type.h:562
rb_obj_freeze_inline
void rb_obj_freeze_inline(VALUE obj)
Prevents further modifications to the given object.
Definition variable.c:1991
RB_OBJ_FROZEN
static bool RB_OBJ_FROZEN(VALUE obj)
Checks if an object is frozen.
Definition fl_type.h:892
RB_OBJ_TAINTED
static bool RB_OBJ_TAINTED(VALUE obj)
Definition fl_type.h:786
RB_OBJ_TAINTED_RAW
static VALUE RB_OBJ_TAINTED_RAW(VALUE obj)
Definition fl_type.h:768
RB_OBJ_INFECT
static void RB_OBJ_INFECT(VALUE dst, VALUE src)
Definition fl_type.h:853
RB_FL_UNSET_RAW
static void RB_FL_UNSET_RAW(VALUE obj, VALUE flags)
This is an implementation detail of RB_FL_UNSET().
Definition fl_type.h:660
RB_FL_SET
static void RB_FL_SET(VALUE obj, VALUE flags)
Sets the given flag(s).
Definition fl_type.h:620
RB_OBJ_INFECT_RAW
static void RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
Definition fl_type.h:835
RB_FL_REVERSE
static void RB_FL_REVERSE(VALUE obj, VALUE flags)
Reverses the flags.
Definition fl_type.h:731
RB_FL_UNSET
static void RB_FL_UNSET(VALUE obj, VALUE flags)
Clears the given flag(s).
Definition fl_type.h:675
RB_OBJ_FREEZE_RAW
static void RB_OBJ_FREEZE_RAW(VALUE obj)
This is an implementation detail of RB_OBJ_FREEZE().
Definition fl_type.h:922
RB_FL_REVERSE_RAW
static void RB_FL_REVERSE_RAW(VALUE obj, VALUE flags)
This is an implementation detail of RB_FL_REVERSE().
Definition fl_type.h:715
RB_FL_ALL_RAW
static bool RB_FL_ALL_RAW(VALUE obj, VALUE flags)
This is an implementation detail of RB_FL_ALL().
Definition fl_type.h:546
ruby_fl_type
ruby_fl_type
The flags.
Definition fl_type.h:184
RUBY_ELTS_SHARED
@ RUBY_ELTS_SHARED
This flag has something to do with data structures.
Definition fl_type.h:369
RUBY_FL_UNUSED10
@ RUBY_FL_UNUSED10
This flag is no longer in use.
Definition fl_type.h:309
RUBY_FL_SINGLETON
@ RUBY_FL_SINGLETON
This flag has something to do with an object's class.
Definition fl_type.h:394
RUBY_FL_TAINT
@ RUBY_FL_TAINT
Definition fl_type.h:245
RUBY_FL_UNUSED9
@ RUBY_FL_UNUSED9
This flag is no longer in use.
Definition fl_type.h:302
RUBY_FL_WB_PROTECTED
@ RUBY_FL_WB_PROTECTED
Definition fl_type.h:198
RUBY_FL_EXIVAR
@ RUBY_FL_EXIVAR
Definition fl_type.h:260
RUBY_FL_UNTRUSTED
@ RUBY_FL_UNTRUSTED
Definition fl_type.h:287
RUBY_FL_PROMOTED
@ RUBY_FL_PROMOTED
Ruby objects are "generational".
Definition fl_type.h:217
RUBY_FL_USER0
@ RUBY_FL_USER0
User-defined flag.
Definition fl_type.h:324
RUBY_FL_FREEZE
@ RUBY_FL_FREEZE
This flag has something to do with data immutability.
Definition fl_type.h:320
RUBY_FL_USERPRIV0
@ RUBY_FL_USERPRIV0
This flag meaning is type dependent, currently only used by T_DATA.
Definition fl_type.h:224
RUBY_FL_USER1
@ RUBY_FL_USER1
User-defined flag.
Definition fl_type.h:325
RUBY_FL_SHAREABLE
@ RUBY_FL_SHAREABLE
This flag has something to do with Ractor.
Definition fl_type.h:280
RUBY_FL_FINALIZE
@ RUBY_FL_FINALIZE
This flag has something to do with finalisers.
Definition fl_type.h:238
RB_OBJ_TAINT_RAW
static void RB_OBJ_TAINT_RAW(VALUE obj)
Definition fl_type.h:802
RBIMPL_FL_USER_N
#define RBIMPL_FL_USER_N(n)
(@shyouhei doesn't know how to excude this macro from doxygen).
Definition fl_type.h:323
RB_OBJ_TAINT
static void RB_OBJ_TAINT(VALUE obj)
Definition fl_type.h:818
flag_enum.h
Defines RBIMPL_ATTR_FLAG_ENUM.
RBIMPL_ATTR_FLAG_ENUM
#define RBIMPL_ATTR_FLAG_ENUM()
Wraps (or simulates) __attribute__((flag_enum).
Definition flag_enum.h:30
forceinline.h
Defines RBIMPL_ATTR_FORCEINLINE.
RBIMPL_ATTR_FORCEINLINE
#define RBIMPL_ATTR_FORCEINLINE()
Wraps (or simulates) __forceinline.
Definition forceinline.h:37
rb_freeze_singleton_class
void rb_freeze_singleton_class(VALUE x)
This is an implementation detail of RB_OBJ_FREEZE().
Definition class.c:2764
defines.h
RB_GNUC_EXTENSION
#define RB_GNUC_EXTENSION
This is expanded to nothing for non-GCC compilers.
Definition defines.h:89
extension.h
Defines RBIMPL_HAS_EXTENSION.
noalias.h
Defines RBIMPL_ATTR_NOALIAS.
RBIMPL_ATTR_NOALIAS
#define RBIMPL_ATTR_NOALIAS()
Wraps (or simulates) __declspec((noalias)).
Definition noalias.h:66
inline
#define inline
Old Visual Studio versions do not support the inline keyword, so we need to define it to be __inline.
Definition defines.h:91
pure.h
Defines RBIMPL_ATTR_PURE.
RBIMPL_ATTR_PURE_UNLESS_DEBUG
#define RBIMPL_ATTR_PURE_UNLESS_DEBUG()
Enables RBIMPL_ATTR_PURE if and only if.
Definition pure.h:38
rbasic.h
Defines struct RBasic.
RBASIC
#define RBASIC(obj)
Convenient casting macro.
Definition rbasic.h:40
special_consts.h
Defines enum ruby_special_consts.
RB_SPECIAL_CONST_P
static bool RB_SPECIAL_CONST_P(VALUE obj)
Checks if the given object is of enum ruby_special_consts.
Definition special_consts.h:327
stdbool.h
C99 shim for <stdbool.h>.
RBasic
Ruby object's base components.
Definition rbasic.h:69
value.h
Defines VALUE and ID.
RBIMPL_VALUE_NULL
#define RBIMPL_VALUE_NULL
A compile-time constant of type VALUE whose value is 0.
Definition value.h:76
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40
value_type.h
Defines enum ruby_value_type.
RB_TYPE_P
static bool RB_TYPE_P(VALUE obj, enum ruby_value_type t)
Queries if the given object is of given type.
Definition value_type.h:376
RUBY_T_NODE
@ RUBY_T_NODE
Definition value_type.h:140
RUBY_T_MASK
@ RUBY_T_MASK
Bitmask of ruby_value_type.
Definition value_type.h:145