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

Ruby 3.3.7p123 (2025-01-15 revision be31f993d7fa0219d85f7b3c694d454da4ecc10b)

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_SEEN_OBJ_ID RBIMPL_CAST((VALUE)RUBY_FL_SEEN_OBJ_ID)
66#define FL_EXIVAR RBIMPL_CAST((VALUE)RUBY_FL_EXIVAR)
67#define FL_FREEZE RBIMPL_CAST((VALUE)RUBY_FL_FREEZE)
68
69#define FL_USHIFT RBIMPL_CAST((VALUE)RUBY_FL_USHIFT)
70
71#define FL_USER0 RBIMPL_CAST((VALUE)RUBY_FL_USER0)
72#define FL_USER1 RBIMPL_CAST((VALUE)RUBY_FL_USER1)
73#define FL_USER2 RBIMPL_CAST((VALUE)RUBY_FL_USER2)
74#define FL_USER3 RBIMPL_CAST((VALUE)RUBY_FL_USER3)
75#define FL_USER4 RBIMPL_CAST((VALUE)RUBY_FL_USER4)
76#define FL_USER5 RBIMPL_CAST((VALUE)RUBY_FL_USER5)
77#define FL_USER6 RBIMPL_CAST((VALUE)RUBY_FL_USER6)
78#define FL_USER7 RBIMPL_CAST((VALUE)RUBY_FL_USER7)
79#define FL_USER8 RBIMPL_CAST((VALUE)RUBY_FL_USER8)
80#define FL_USER9 RBIMPL_CAST((VALUE)RUBY_FL_USER9)
81#define FL_USER10 RBIMPL_CAST((VALUE)RUBY_FL_USER10)
82#define FL_USER11 RBIMPL_CAST((VALUE)RUBY_FL_USER11)
83#define FL_USER12 RBIMPL_CAST((VALUE)RUBY_FL_USER12)
84#define FL_USER13 RBIMPL_CAST((VALUE)RUBY_FL_USER13)
85#define FL_USER14 RBIMPL_CAST((VALUE)RUBY_FL_USER14)
86#define FL_USER15 RBIMPL_CAST((VALUE)RUBY_FL_USER15)
87#define FL_USER16 RBIMPL_CAST((VALUE)RUBY_FL_USER16)
88#define FL_USER17 RBIMPL_CAST((VALUE)RUBY_FL_USER17)
89#define FL_USER18 RBIMPL_CAST((VALUE)RUBY_FL_USER18)
90#define FL_USER19 RBIMPL_CAST((VALUE)(unsigned int)RUBY_FL_USER19)
91
92#define ELTS_SHARED RUBY_ELTS_SHARED
93#define RB_OBJ_FREEZE rb_obj_freeze_inline
94
96#define RUBY_ELTS_SHARED RUBY_ELTS_SHARED
97#define RB_FL_ABLE RB_FL_ABLE
98#define RB_FL_ALL RB_FL_ALL
99#define RB_FL_ALL_RAW RB_FL_ALL_RAW
100#define RB_FL_ANY RB_FL_ANY
101#define RB_FL_ANY_RAW RB_FL_ANY_RAW
102#define RB_FL_REVERSE RB_FL_REVERSE
103#define RB_FL_REVERSE_RAW RB_FL_REVERSE_RAW
104#define RB_FL_SET RB_FL_SET
105#define RB_FL_SET_RAW RB_FL_SET_RAW
106#define RB_FL_TEST RB_FL_TEST
107#define RB_FL_TEST_RAW RB_FL_TEST_RAW
108#define RB_FL_UNSET RB_FL_UNSET
109#define RB_FL_UNSET_RAW RB_FL_UNSET_RAW
110#define RB_OBJ_FREEZE_RAW RB_OBJ_FREEZE_RAW
111#define RB_OBJ_FROZEN RB_OBJ_FROZEN
112#define RB_OBJ_FROZEN_RAW RB_OBJ_FROZEN_RAW
113#define RB_OBJ_UNTRUST RB_OBJ_TAINT
114#define RB_OBJ_UNTRUSTED RB_OBJ_TAINTED
116
122#define FL_ABLE RB_FL_ABLE
123#define FL_ALL RB_FL_ALL
124#define FL_ALL_RAW RB_FL_ALL_RAW
125#define FL_ANY RB_FL_ANY
126#define FL_ANY_RAW RB_FL_ANY_RAW
127#define FL_REVERSE RB_FL_REVERSE
128#define FL_REVERSE_RAW RB_FL_REVERSE_RAW
129#define FL_SET RB_FL_SET
130#define FL_SET_RAW RB_FL_SET_RAW
131#define FL_TEST RB_FL_TEST
132#define FL_TEST_RAW RB_FL_TEST_RAW
133#define FL_UNSET RB_FL_UNSET
134#define FL_UNSET_RAW RB_FL_UNSET_RAW
135#define OBJ_FREEZE RB_OBJ_FREEZE
136#define OBJ_FREEZE_RAW RB_OBJ_FREEZE_RAW
137#define OBJ_FROZEN RB_OBJ_FROZEN
138#define OBJ_FROZEN_RAW RB_OBJ_FROZEN_RAW
139#define OBJ_INFECT RB_OBJ_INFECT
140#define OBJ_INFECT_RAW RB_OBJ_INFECT_RAW
141#define OBJ_TAINT RB_OBJ_TAINT
142#define OBJ_TAINTABLE RB_OBJ_TAINTABLE
143#define OBJ_TAINTED RB_OBJ_TAINTED
144#define OBJ_TAINTED_RAW RB_OBJ_TAINTED_RAW
145#define OBJ_TAINT_RAW RB_OBJ_TAINT_RAW
146#define OBJ_UNTRUST RB_OBJ_UNTRUST
147#define OBJ_UNTRUSTED RB_OBJ_UNTRUSTED
149
154 enum ruby_fl_ushift {
159 RUBY_FL_USHIFT = 12
160};
161
162/* > The expression that defines the value of an enumeration constant shall be
163 * > an integer constant expression that has a value representable as an `int`.
164 *
165 * -- ISO/IEC 9899:2018 section 6.7.2.2
166 *
167 * So ENUM_OVER_INT situation is an extension to the standard. Note however
168 * that we do not support 16 bit `int` environment. */
169 RB_GNUC_EXTENSION
183 enum
184 RBIMPL_ATTR_FLAG_ENUM()
185 ruby_fl_type {
186
199 RUBY_FL_WB_PROTECTED = (1<<5),
200
218 RUBY_FL_PROMOTED = (1<<5),
219
225 RUBY_FL_UNUSED6 = (1<<6),
226
239 RUBY_FL_FINALIZE = (1<<7),
240
246 RUBY_FL_TAINT
247
248#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
249 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
250#elif defined(_MSC_VER)
251# pragma deprecated(RUBY_FL_TAINT)
252#endif
253
254 = 0,
255
266 RUBY_FL_SHAREABLE = (1<<8),
267
273 RUBY_FL_UNTRUSTED
274
275#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
276 RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
277#elif defined(_MSC_VER)
278# pragma deprecated(RUBY_FL_UNTRUSTED)
279#endif
280
281 = 0,
282
300 RUBY_FL_SEEN_OBJ_ID = (1<<9),
301
313 RUBY_FL_EXIVAR = (1<<10),
314
324 RUBY_FL_FREEZE = (1<<11),
325
327#define RBIMPL_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
328 RBIMPL_FL_USER_N(0),
329 RBIMPL_FL_USER_N(1),
330 RBIMPL_FL_USER_N(2),
331 RBIMPL_FL_USER_N(3),
332 RBIMPL_FL_USER_N(4),
333 RBIMPL_FL_USER_N(5),
334 RBIMPL_FL_USER_N(6),
335 RBIMPL_FL_USER_N(7),
336 RBIMPL_FL_USER_N(8),
337 RBIMPL_FL_USER_N(9),
338 RBIMPL_FL_USER_N(10),
339 RBIMPL_FL_USER_N(11),
340 RBIMPL_FL_USER_N(12),
341 RBIMPL_FL_USER_N(13),
342 RBIMPL_FL_USER_N(14),
343 RBIMPL_FL_USER_N(15),
344 RBIMPL_FL_USER_N(16),
345 RBIMPL_FL_USER_N(17),
346 RBIMPL_FL_USER_N(18),
347#ifdef ENUM_OVER_INT
348 RBIMPL_FL_USER_N(19),
349#else
350# define RUBY_FL_USER19 (RBIMPL_VALUE_ONE<<(RUBY_FL_USHIFT+19))
351#endif
352#undef RBIMPL_FL_USER_N
353#undef RBIMPL_WIDER_ENUM
354
373 RUBY_ELTS_SHARED = RUBY_FL_USER2,
374
398 RUBY_FL_SINGLETON = RUBY_FL_USER0,
399};
400
401enum {
407 RUBY_FL_DUPPED
408
409#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
410 RBIMPL_ATTR_DEPRECATED(("It seems there is no actual usage of this enum."))
411#elif defined(_MSC_VER)
412# pragma deprecated(RUBY_FL_DUPPED)
413#endif
414
415 = (int)RUBY_T_MASK | (int)RUBY_FL_EXIVAR
416};
417
418#undef RBIMPL_HAVE_ENUM_ATTRIBUTE
419
420 RBIMPL_SYMBOL_EXPORT_BEGIN()
428void rb_freeze_singleton_class(VALUE klass);
429 RBIMPL_SYMBOL_EXPORT_END()
430
431 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
432 RBIMPL_ATTR_ARTIFICIAL()
433 RBIMPL_ATTR_FORCEINLINE()
443static bool
444RB_FL_ABLE(VALUE obj)
445{
446 if (RB_SPECIAL_CONST_P(obj)) {
447 return false;
448 }
449 else if (RB_TYPE_P(obj, RUBY_T_NODE)) {
450 return false;
451 }
452 else {
453 return true;
454 }
455}
456
457 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
458 RBIMPL_ATTR_ARTIFICIAL()
468static inline VALUE
469RB_FL_TEST_RAW(VALUE obj, VALUE flags)
470{
471 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
472 return RBASIC(obj)->flags & flags;
473}
474
475 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
476 RBIMPL_ATTR_ARTIFICIAL()
494static inline VALUE
495RB_FL_TEST(VALUE obj, VALUE flags)
496{
497 if (RB_FL_ABLE(obj)) {
498 return RB_FL_TEST_RAW(obj, flags);
499 }
500 else {
501 return RBIMPL_VALUE_NULL;
502 }
503}
504
505 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
506 RBIMPL_ATTR_ARTIFICIAL()
517static inline bool
518RB_FL_ANY_RAW(VALUE obj, VALUE flags)
519{
520 return RB_FL_TEST_RAW(obj, flags);
521}
522
523 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
524 RBIMPL_ATTR_ARTIFICIAL()
533static inline bool
534RB_FL_ANY(VALUE obj, VALUE flags)
535{
536 return RB_FL_TEST(obj, flags);
537}
538
539 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
540 RBIMPL_ATTR_ARTIFICIAL()
551static inline bool
552RB_FL_ALL_RAW(VALUE obj, VALUE flags)
553{
554 return RB_FL_TEST_RAW(obj, flags) == flags;
555}
556
557 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
558 RBIMPL_ATTR_ARTIFICIAL()
567static inline bool
568RB_FL_ALL(VALUE obj, VALUE flags)
569{
570 return RB_FL_TEST(obj, flags) == flags;
571}
572
573 RBIMPL_ATTR_NOALIAS()
574 RBIMPL_ATTR_ARTIFICIAL()
590static inline void
591rbimpl_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
592{
593 obj->flags |= flags;
594}
595
596 RBIMPL_ATTR_ARTIFICIAL()
605static inline void
606RB_FL_SET_RAW(VALUE obj, VALUE flags)
607{
608 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
609 rbimpl_fl_set_raw_raw(RBASIC(obj), flags);
610}
611
612 RBIMPL_ATTR_ARTIFICIAL()
625static inline void
626RB_FL_SET(VALUE obj, VALUE flags)
627{
628 if (RB_FL_ABLE(obj)) {
629 RB_FL_SET_RAW(obj, flags);
630 }
631}
632
633 RBIMPL_ATTR_NOALIAS()
634 RBIMPL_ATTR_ARTIFICIAL()
650static inline void
651rbimpl_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
652{
653 obj->flags &= ~flags;
654}
655
656 RBIMPL_ATTR_ARTIFICIAL()
665static inline void
666RB_FL_UNSET_RAW(VALUE obj, VALUE flags)
667{
668 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
669 rbimpl_fl_unset_raw_raw(RBASIC(obj), flags);
670}
671
672 RBIMPL_ATTR_ARTIFICIAL()
680static inline void
681RB_FL_UNSET(VALUE obj, VALUE flags)
682{
683 if (RB_FL_ABLE(obj)) {
684 RB_FL_UNSET_RAW(obj, flags);
685 }
686}
687
688 RBIMPL_ATTR_NOALIAS()
689 RBIMPL_ATTR_ARTIFICIAL()
705static inline void
706rbimpl_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
707{
708 obj->flags ^= flags;
709}
710
711 RBIMPL_ATTR_ARTIFICIAL()
720static inline void
721RB_FL_REVERSE_RAW(VALUE obj, VALUE flags)
722{
723 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
724 rbimpl_fl_reverse_raw_raw(RBASIC(obj), flags);
725}
726
727 RBIMPL_ATTR_ARTIFICIAL()
736static inline void
737RB_FL_REVERSE(VALUE obj, VALUE flags)
738{
739 if (RB_FL_ABLE(obj)) {
740 RB_FL_REVERSE_RAW(obj, flags);
741 }
742}
743
744 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
745 RBIMPL_ATTR_ARTIFICIAL()
746 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
755static inline bool
756RB_OBJ_TAINTABLE(VALUE obj)
757{
758 (void)obj;
759 return false;
760}
761
762 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
763 RBIMPL_ATTR_ARTIFICIAL()
764 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
773static inline VALUE
774RB_OBJ_TAINTED_RAW(VALUE obj)
775{
776 (void)obj;
777 return false;
778}
779
780 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
781 RBIMPL_ATTR_ARTIFICIAL()
782 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
791static inline bool
792RB_OBJ_TAINTED(VALUE obj)
793{
794 (void)obj;
795 return false;
796}
797
798 RBIMPL_ATTR_ARTIFICIAL()
799 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
807static inline void
808RB_OBJ_TAINT_RAW(VALUE obj)
809{
810 (void)obj;
811 return;
812}
813
814 RBIMPL_ATTR_ARTIFICIAL()
815 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
823static inline void
824RB_OBJ_TAINT(VALUE obj)
825{
826 (void)obj;
827 return;
828}
829
830 RBIMPL_ATTR_ARTIFICIAL()
831 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
840static inline void
841RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
842{
843 (void)dst;
844 (void)src;
845 return;
846}
847
848 RBIMPL_ATTR_ARTIFICIAL()
849 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
858static inline void
859RB_OBJ_INFECT(VALUE dst, VALUE src)
860{
861 (void)dst;
862 (void)src;
863 return;
864}
865
866 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
867 RBIMPL_ATTR_ARTIFICIAL()
882static inline VALUE
883RB_OBJ_FROZEN_RAW(VALUE obj)
884{
885 return RB_FL_TEST_RAW(obj, RUBY_FL_FREEZE);
886}
887
888 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
889 RBIMPL_ATTR_ARTIFICIAL()
897static inline bool
898RB_OBJ_FROZEN(VALUE obj)
899{
900 if (! RB_FL_ABLE(obj)) {
901 return true;
902 }
903 else {
904 return RB_OBJ_FROZEN_RAW(obj);
905 }
906}
907
908 RBIMPL_ATTR_ARTIFICIAL()
915static inline void
916RB_OBJ_FREEZE_RAW(VALUE obj)
917{
918 RB_FL_SET_RAW(obj, RUBY_FL_FREEZE);
919}
920
921RUBY_SYMBOL_EXPORT_BEGIN
922void rb_obj_freeze_inline(VALUE obj);
923RUBY_SYMBOL_EXPORT_END
924
925#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(expr)
This is either RUBY_ASSERT or RBIMPL_ASSUME, depending on RUBY_DEBUG.
Definition assert.h:229
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:407
ruby_fl_ushift
ruby_fl_ushift
This is an enum because GDB wants it (rather than a macro).
Definition fl_type.h:154
RUBY_FL_USHIFT
@ RUBY_FL_USHIFT
Number of bits in ruby_fl_type that are not open to users.
Definition fl_type.h:159
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:883
RB_OBJ_TAINTABLE
static bool RB_OBJ_TAINTABLE(VALUE obj)
Definition fl_type.h:756
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:495
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:469
RB_FL_ABLE
static bool RB_FL_ABLE(VALUE obj)
Checks if the object is flaggable.
Definition fl_type.h:444
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:518
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:534
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:606
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:568
rb_obj_freeze_inline
void rb_obj_freeze_inline(VALUE obj)
Prevents further modifications to the given object.
Definition variable.c:1810
RB_OBJ_TAINTED
static bool RB_OBJ_TAINTED(VALUE obj)
Definition fl_type.h:792
RB_OBJ_TAINTED_RAW
static VALUE RB_OBJ_TAINTED_RAW(VALUE obj)
Definition fl_type.h:774
RB_OBJ_INFECT
static void RB_OBJ_INFECT(VALUE dst, VALUE src)
Definition fl_type.h:859
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:666
RB_FL_SET
static void RB_FL_SET(VALUE obj, VALUE flags)
Sets the given flag(s).
Definition fl_type.h:626
RB_OBJ_INFECT_RAW
static void RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
Definition fl_type.h:841
RB_FL_REVERSE
static void RB_FL_REVERSE(VALUE obj, VALUE flags)
Reverses the flags.
Definition fl_type.h:737
RB_FL_UNSET
static void RB_FL_UNSET(VALUE obj, VALUE flags)
Clears the given flag(s).
Definition fl_type.h:681
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:916
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:721
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:552
ruby_fl_type
ruby_fl_type
The flags.
Definition fl_type.h:185
RUBY_ELTS_SHARED
@ RUBY_ELTS_SHARED
This flag has something to do with data structures.
Definition fl_type.h:373
RUBY_FL_SINGLETON
@ RUBY_FL_SINGLETON
This flag has something to do with an object's class.
Definition fl_type.h:398
RUBY_FL_TAINT
@ RUBY_FL_TAINT
Definition fl_type.h:246
RUBY_FL_WB_PROTECTED
@ RUBY_FL_WB_PROTECTED
Definition fl_type.h:199
RUBY_FL_EXIVAR
@ RUBY_FL_EXIVAR
This flag has something to do with instance variables.
Definition fl_type.h:313
RUBY_FL_UNTRUSTED
@ RUBY_FL_UNTRUSTED
Definition fl_type.h:273
RUBY_FL_PROMOTED
@ RUBY_FL_PROMOTED
Ruby objects are "generational".
Definition fl_type.h:218
RUBY_FL_UNUSED6
@ RUBY_FL_UNUSED6
This flag is no longer in use.
Definition fl_type.h:225
RUBY_FL_USER0
@ RUBY_FL_USER0
User-defined flag.
Definition fl_type.h:328
RUBY_FL_FREEZE
@ RUBY_FL_FREEZE
This flag has something to do with data immutability.
Definition fl_type.h:324
RUBY_FL_SEEN_OBJ_ID
@ RUBY_FL_SEEN_OBJ_ID
This flag has something to do with object IDs.
Definition fl_type.h:300
RUBY_FL_USER2
@ RUBY_FL_USER2
User-defined flag.
Definition fl_type.h:330
RUBY_FL_SHAREABLE
@ RUBY_FL_SHAREABLE
This flag has something to do with Ractor.
Definition fl_type.h:266
RUBY_FL_FINALIZE
@ RUBY_FL_FINALIZE
This flag has something to do with finalisers.
Definition fl_type.h:239
RB_OBJ_TAINT_RAW
static void RB_OBJ_TAINT_RAW(VALUE obj)
Definition fl_type.h:808
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:327
RB_OBJ_TAINT
static void RB_OBJ_TAINT(VALUE obj)
Definition fl_type.h:824
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:2250
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:66
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's object's, base components.
Definition rbasic.h:64
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.
RUBY_T_NODE
@ RUBY_T_NODE
Definition value_type.h:139
RUBY_T_MASK
@ RUBY_T_MASK
Bitmask of ruby_value_type.
Definition value_type.h:144