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

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

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
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_PROMOTED0 RBIMPL_CAST((VALUE)RUBY_FL_PROMOTED0)
61#define FL_PROMOTED1 RBIMPL_CAST((VALUE)RUBY_FL_PROMOTED1)
62#define FL_FINALIZE RBIMPL_CAST((VALUE)RUBY_FL_FINALIZE)
63#define FL_TAINT RBIMPL_CAST((VALUE)RUBY_FL_TAINT)
64#define FL_SHAREABLE RBIMPL_CAST((VALUE)RUBY_FL_SHAREABLE)
65#define FL_UNTRUSTED RBIMPL_CAST((VALUE)RUBY_FL_UNTRUSTED)
66#define FL_SEEN_OBJ_ID RBIMPL_CAST((VALUE)RUBY_FL_SEEN_OBJ_ID)
67#define FL_EXIVAR RBIMPL_CAST((VALUE)RUBY_FL_EXIVAR)
68#define FL_FREEZE RBIMPL_CAST((VALUE)RUBY_FL_FREEZE)
70#define FL_USHIFT RBIMPL_CAST((VALUE)RUBY_FL_USHIFT)
72#define FL_USER0 RBIMPL_CAST((VALUE)RUBY_FL_USER0)
73#define FL_USER1 RBIMPL_CAST((VALUE)RUBY_FL_USER1)
74#define FL_USER2 RBIMPL_CAST((VALUE)RUBY_FL_USER2)
75#define FL_USER3 RBIMPL_CAST((VALUE)RUBY_FL_USER3)
76#define FL_USER4 RBIMPL_CAST((VALUE)RUBY_FL_USER4)
77#define FL_USER5 RBIMPL_CAST((VALUE)RUBY_FL_USER5)
78#define FL_USER6 RBIMPL_CAST((VALUE)RUBY_FL_USER6)
79#define FL_USER7 RBIMPL_CAST((VALUE)RUBY_FL_USER7)
80#define FL_USER8 RBIMPL_CAST((VALUE)RUBY_FL_USER8)
81#define FL_USER9 RBIMPL_CAST((VALUE)RUBY_FL_USER9)
82#define FL_USER10 RBIMPL_CAST((VALUE)RUBY_FL_USER10)
83#define FL_USER11 RBIMPL_CAST((VALUE)RUBY_FL_USER11)
84#define FL_USER12 RBIMPL_CAST((VALUE)RUBY_FL_USER12)
85#define FL_USER13 RBIMPL_CAST((VALUE)RUBY_FL_USER13)
86#define FL_USER14 RBIMPL_CAST((VALUE)RUBY_FL_USER14)
87#define FL_USER15 RBIMPL_CAST((VALUE)RUBY_FL_USER15)
88#define FL_USER16 RBIMPL_CAST((VALUE)RUBY_FL_USER16)
89#define FL_USER17 RBIMPL_CAST((VALUE)RUBY_FL_USER17)
90#define FL_USER18 RBIMPL_CAST((VALUE)RUBY_FL_USER18)
91#define FL_USER19 RBIMPL_CAST((VALUE)(unsigned int)RUBY_FL_USER19)
93#define ELTS_SHARED RUBY_ELTS_SHARED
94#define RB_OBJ_FREEZE rb_obj_freeze_inline
97#define RUBY_ELTS_SHARED RUBY_ELTS_SHARED
98#define RB_FL_ABLE RB_FL_ABLE
99#define RB_FL_ALL RB_FL_ALL
100#define RB_FL_ALL_RAW RB_FL_ALL_RAW
101#define RB_FL_ANY RB_FL_ANY
102#define RB_FL_ANY_RAW RB_FL_ANY_RAW
103#define RB_FL_REVERSE RB_FL_REVERSE
104#define RB_FL_REVERSE_RAW RB_FL_REVERSE_RAW
105#define RB_FL_SET RB_FL_SET
106#define RB_FL_SET_RAW RB_FL_SET_RAW
107#define RB_FL_TEST RB_FL_TEST
108#define RB_FL_TEST_RAW RB_FL_TEST_RAW
109#define RB_FL_UNSET RB_FL_UNSET
110#define RB_FL_UNSET_RAW RB_FL_UNSET_RAW
111#define RB_OBJ_FREEZE_RAW RB_OBJ_FREEZE_RAW
112#define RB_OBJ_FROZEN RB_OBJ_FROZEN
113#define RB_OBJ_FROZEN_RAW RB_OBJ_FROZEN_RAW
114#define RB_OBJ_INFECT RB_OBJ_INFECT
115#define RB_OBJ_INFECT_RAW RB_OBJ_INFECT_RAW
116#define RB_OBJ_TAINT RB_OBJ_TAINT
117#define RB_OBJ_TAINTABLE RB_OBJ_TAINTABLE
118#define RB_OBJ_TAINTED RB_OBJ_TAINTED
119#define RB_OBJ_TAINTED_RAW RB_OBJ_TAINTED_RAW
120#define RB_OBJ_TAINT_RAW RB_OBJ_TAINT_RAW
121#define RB_OBJ_UNTRUST RB_OBJ_TAINT
122#define RB_OBJ_UNTRUSTED RB_OBJ_TAINTED
130#define FL_ABLE RB_FL_ABLE
131#define FL_ALL RB_FL_ALL
132#define FL_ALL_RAW RB_FL_ALL_RAW
133#define FL_ANY RB_FL_ANY
134#define FL_ANY_RAW RB_FL_ANY_RAW
135#define FL_REVERSE RB_FL_REVERSE
136#define FL_REVERSE_RAW RB_FL_REVERSE_RAW
137#define FL_SET RB_FL_SET
138#define FL_SET_RAW RB_FL_SET_RAW
139#define FL_TEST RB_FL_TEST
140#define FL_TEST_RAW RB_FL_TEST_RAW
141#define FL_UNSET RB_FL_UNSET
142#define FL_UNSET_RAW RB_FL_UNSET_RAW
143#define OBJ_FREEZE RB_OBJ_FREEZE
144#define OBJ_FREEZE_RAW RB_OBJ_FREEZE_RAW
145#define OBJ_FROZEN RB_OBJ_FROZEN
146#define OBJ_FROZEN_RAW RB_OBJ_FROZEN_RAW
147#define OBJ_INFECT RB_OBJ_INFECT
148#define OBJ_INFECT_RAW RB_OBJ_INFECT_RAW
149#define OBJ_TAINT RB_OBJ_TAINT
150#define OBJ_TAINTABLE RB_OBJ_TAINTABLE
151#define OBJ_TAINTED RB_OBJ_TAINTED
152#define OBJ_TAINTED_RAW RB_OBJ_TAINTED_RAW
153#define OBJ_TAINT_RAW RB_OBJ_TAINT_RAW
154#define OBJ_UNTRUST RB_OBJ_UNTRUST
155#define OBJ_UNTRUSTED RB_OBJ_UNTRUSTED
162 enum ruby_fl_ushift {
167 RUBY_FL_USHIFT = 12
168};
169
170/* > The expression that defines the value of an enumeration constant shall be
171 * > an integer constant expression that has a value representable as an `int`.
172 *
173 * -- ISO/IEC 9899:2018 section 6.7.2.2
174 *
175 * So ENUM_OVER_INT situation is an extension to the standard. Note however
176 * that we do not support 16 bit `int` environment. */
177 RB_GNUC_EXTENSION
191 enum
192 RBIMPL_ATTR_FLAG_ENUM()
193 ruby_fl_type {
194
207 RUBY_FL_WB_PROTECTED = (1<<5),
208
223 RUBY_FL_PROMOTED0 = (1<<5),
224
240 RUBY_FL_PROMOTED1 = (1<<6),
241
257 RUBY_FL_PROMOTED = RUBY_FL_PROMOTED0 | RUBY_FL_PROMOTED1,
258
271 RUBY_FL_FINALIZE = (1<<7),
272
278 RUBY_FL_TAINT
279
280#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
281 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
282#elif defined(_MSC_VER)
283# pragma deprecated(RUBY_FL_TAINT)
284#endif
285
286 = (1<<8),
287
298 RUBY_FL_SHAREABLE = (1<<8),
299
305 RUBY_FL_UNTRUSTED
306
307#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
308 RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
309#elif defined(_MSC_VER)
310# pragma deprecated(RUBY_FL_UNTRUSTED)
311#endif
312
313 = (1<<8),
314
332 RUBY_FL_SEEN_OBJ_ID = (1<<9),
333
345 RUBY_FL_EXIVAR = (1<<10),
346
356 RUBY_FL_FREEZE = (1<<11),
357
359#define RBIMPL_FL_USER_N(n) RUBY_FL_USER##n = (1<<(RUBY_FL_USHIFT+n))
360 RBIMPL_FL_USER_N(0),
361 RBIMPL_FL_USER_N(1),
362 RBIMPL_FL_USER_N(2),
363 RBIMPL_FL_USER_N(3),
364 RBIMPL_FL_USER_N(4),
365 RBIMPL_FL_USER_N(5),
366 RBIMPL_FL_USER_N(6),
367 RBIMPL_FL_USER_N(7),
368 RBIMPL_FL_USER_N(8),
369 RBIMPL_FL_USER_N(9),
370 RBIMPL_FL_USER_N(10),
371 RBIMPL_FL_USER_N(11),
372 RBIMPL_FL_USER_N(12),
373 RBIMPL_FL_USER_N(13),
374 RBIMPL_FL_USER_N(14),
375 RBIMPL_FL_USER_N(15),
376 RBIMPL_FL_USER_N(16),
377 RBIMPL_FL_USER_N(17),
378 RBIMPL_FL_USER_N(18),
379#ifdef ENUM_OVER_INT
380 RBIMPL_FL_USER_N(19),
381#else
382# define RUBY_FL_USER19 (RBIMPL_VALUE_ONE<<(RUBY_FL_USHIFT+19))
383#endif
384#undef RBIMPL_FL_USER_N
385#undef RBIMPL_WIDER_ENUM
386
405 RUBY_ELTS_SHARED = RUBY_FL_USER2,
406
430 RUBY_FL_SINGLETON = RUBY_FL_USER0,
431};
432
433enum {
439 RUBY_FL_DUPPED
440
441#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
442 RBIMPL_ATTR_DEPRECATED(("It seems there is no actual usage of this enum."))
443#elif defined(_MSC_VER)
444# pragma deprecated(RUBY_FL_DUPPED)
445#endif
446
447 = (int)RUBY_T_MASK | (int)RUBY_FL_EXIVAR
448};
449
450#undef RBIMPL_HAVE_ENUM_ATTRIBUTE
451
452 RBIMPL_SYMBOL_EXPORT_BEGIN()
460void rb_freeze_singleton_class(VALUE klass);
461 RBIMPL_SYMBOL_EXPORT_END()
462
463 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
464 RBIMPL_ATTR_ARTIFICIAL()
465 RBIMPL_ATTR_FORCEINLINE()
475static bool
476RB_FL_ABLE(VALUE obj)
477{
478 if (RB_SPECIAL_CONST_P(obj)) {
479 return false;
480 }
481 else if (RB_TYPE_P(obj, RUBY_T_NODE)) {
482 return false;
483 }
484 else {
485 return true;
486 }
487}
488
489 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
490 RBIMPL_ATTR_ARTIFICIAL()
500static inline VALUE
501RB_FL_TEST_RAW(VALUE obj, VALUE flags)
502{
503 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
504 return RBASIC(obj)->flags & flags;
505}
506
507 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
508 RBIMPL_ATTR_ARTIFICIAL()
526static inline VALUE
527RB_FL_TEST(VALUE obj, VALUE flags)
528{
529 if (RB_FL_ABLE(obj)) {
530 return RB_FL_TEST_RAW(obj, flags);
531 }
532 else {
533 return RBIMPL_VALUE_NULL;
534 }
535}
536
537 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
538 RBIMPL_ATTR_ARTIFICIAL()
549static inline bool
550RB_FL_ANY_RAW(VALUE obj, VALUE flags)
551{
552 return RB_FL_TEST_RAW(obj, flags);
553}
554
555 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
556 RBIMPL_ATTR_ARTIFICIAL()
565static inline bool
566RB_FL_ANY(VALUE obj, VALUE flags)
567{
568 return RB_FL_TEST(obj, flags);
569}
570
571 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
572 RBIMPL_ATTR_ARTIFICIAL()
583static inline bool
584RB_FL_ALL_RAW(VALUE obj, VALUE flags)
585{
586 return RB_FL_TEST_RAW(obj, flags) == flags;
587}
588
589 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
590 RBIMPL_ATTR_ARTIFICIAL()
599static inline bool
600RB_FL_ALL(VALUE obj, VALUE flags)
601{
602 return RB_FL_TEST(obj, flags) == flags;
603}
604
605 RBIMPL_ATTR_NOALIAS()
606 RBIMPL_ATTR_ARTIFICIAL()
622static inline void
623rbimpl_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
624{
625 obj->flags |= flags;
626}
627
628 RBIMPL_ATTR_ARTIFICIAL()
637static inline void
638RB_FL_SET_RAW(VALUE obj, VALUE flags)
639{
640 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
641 rbimpl_fl_set_raw_raw(RBASIC(obj), flags);
642}
643
644 RBIMPL_ATTR_ARTIFICIAL()
657static inline void
658RB_FL_SET(VALUE obj, VALUE flags)
659{
660 if (RB_FL_ABLE(obj)) {
661 RB_FL_SET_RAW(obj, flags);
662 }
663}
664
665 RBIMPL_ATTR_NOALIAS()
666 RBIMPL_ATTR_ARTIFICIAL()
682static inline void
683rbimpl_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
684{
685 obj->flags &= ~flags;
686}
687
688 RBIMPL_ATTR_ARTIFICIAL()
697static inline void
698RB_FL_UNSET_RAW(VALUE obj, VALUE flags)
699{
700 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
701 rbimpl_fl_unset_raw_raw(RBASIC(obj), flags);
702}
703
704 RBIMPL_ATTR_ARTIFICIAL()
712static inline void
713RB_FL_UNSET(VALUE obj, VALUE flags)
714{
715 if (RB_FL_ABLE(obj)) {
716 RB_FL_UNSET_RAW(obj, flags);
717 }
718}
719
720 RBIMPL_ATTR_NOALIAS()
721 RBIMPL_ATTR_ARTIFICIAL()
737static inline void
738rbimpl_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
739{
740 obj->flags ^= flags;
741}
742
743 RBIMPL_ATTR_ARTIFICIAL()
752static inline void
753RB_FL_REVERSE_RAW(VALUE obj, VALUE flags)
754{
755 RBIMPL_ASSERT_OR_ASSUME(RB_FL_ABLE(obj));
756 rbimpl_fl_reverse_raw_raw(RBASIC(obj), flags);
757}
758
759 RBIMPL_ATTR_ARTIFICIAL()
768static inline void
769RB_FL_REVERSE(VALUE obj, VALUE flags)
770{
771 if (RB_FL_ABLE(obj)) {
772 RB_FL_REVERSE_RAW(obj, flags);
773 }
774}
775
776 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
777 RBIMPL_ATTR_ARTIFICIAL()
778 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
787static inline bool
788RB_OBJ_TAINTABLE(VALUE obj)
789{
790 return false;
791}
792
793 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
794 RBIMPL_ATTR_ARTIFICIAL()
795 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
804static inline VALUE
805RB_OBJ_TAINTED_RAW(VALUE obj)
806{
807 return false;
808}
809
810 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
811 RBIMPL_ATTR_ARTIFICIAL()
812 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
821static inline bool
822RB_OBJ_TAINTED(VALUE obj)
823{
824 return false;
825}
826
827 RBIMPL_ATTR_ARTIFICIAL()
828 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
836static inline void
837RB_OBJ_TAINT_RAW(VALUE obj)
838{
839 return;
840}
841
842 RBIMPL_ATTR_ARTIFICIAL()
843 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
851static inline void
852RB_OBJ_TAINT(VALUE obj)
853{
854 return;
855}
856
857 RBIMPL_ATTR_ARTIFICIAL()
858 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
867static inline void
868RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
869{
870 return;
871}
872
873 RBIMPL_ATTR_ARTIFICIAL()
874 RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
883static inline void
884RB_OBJ_INFECT(VALUE dst, VALUE src)
885{
886 return;
887}
888
889 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
890 RBIMPL_ATTR_ARTIFICIAL()
905static inline VALUE
906RB_OBJ_FROZEN_RAW(VALUE obj)
907{
908 return RB_FL_TEST_RAW(obj, RUBY_FL_FREEZE);
909}
910
911 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
912 RBIMPL_ATTR_ARTIFICIAL()
920static inline bool
921RB_OBJ_FROZEN(VALUE obj)
922{
923 if (! RB_FL_ABLE(obj)) {
924 return true;
925 }
926 else {
927 return RB_OBJ_FROZEN_RAW(obj);
928 }
929}
930
931 RBIMPL_ATTR_ARTIFICIAL()
938static inline void
939RB_OBJ_FREEZE_RAW(VALUE obj)
940{
941 RB_FL_SET_RAW(obj, RUBY_FL_FREEZE);
942}
943
944RUBY_SYMBOL_EXPORT_BEGIN
945void rb_obj_freeze_inline(VALUE obj);
946RUBY_SYMBOL_EXPORT_END
947
948#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.
defines.h
RB_GNUC_EXTENSION
#define RB_GNUC_EXTENSION
This is expanded to nothing for non-GCC compilers.
Definition defines.h:89
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:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
extension.h
Defines RBIMPL_HAS_EXTENSION.
ruby_fl_ushift
ruby_fl_ushift
This is an enum because GDB wants it (rather than a macro).
Definition fl_type.h:162
RUBY_FL_USHIFT
@ RUBY_FL_USHIFT
Number of bits in ruby_fl_type that are not open to users.
Definition fl_type.h:167
RB_OBJ_FROZEN_RAW
static VALUE RB_OBJ_FROZEN_RAW(VALUE obj)
This is an implenentation detail of RB_OBJ_FROZEN().
Definition fl_type.h:906
RB_OBJ_TAINTABLE
static bool RB_OBJ_TAINTABLE(VALUE obj)
Definition fl_type.h:788
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:527
RB_FL_TEST_RAW
static VALUE RB_FL_TEST_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_TEST().
Definition fl_type.h:501
RB_FL_ABLE
static bool RB_FL_ABLE(VALUE obj)
Checks if the object is flaggable.
Definition fl_type.h:476
RB_FL_ANY_RAW
static bool RB_FL_ANY_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_ANY().
Definition fl_type.h:550
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:566
RB_FL_SET_RAW
static void RB_FL_SET_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_SET().
Definition fl_type.h:638
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:600
rb_obj_freeze_inline
void rb_obj_freeze_inline(VALUE obj)
Prevents further modifications to the given object.
Definition variable.c:1569
RB_OBJ_FROZEN
static bool RB_OBJ_FROZEN(VALUE obj)
Checks if an object is frozen.
Definition fl_type.h:921
RB_OBJ_TAINTED
static bool RB_OBJ_TAINTED(VALUE obj)
Definition fl_type.h:822
RB_OBJ_TAINTED_RAW
static VALUE RB_OBJ_TAINTED_RAW(VALUE obj)
Definition fl_type.h:805
RB_OBJ_INFECT
static void RB_OBJ_INFECT(VALUE dst, VALUE src)
Definition fl_type.h:884
RB_FL_UNSET_RAW
static void RB_FL_UNSET_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_UNSET().
Definition fl_type.h:698
RUBY_FL_DUPPED
@ RUBY_FL_DUPPED
Definition fl_type.h:439
RB_FL_SET
static void RB_FL_SET(VALUE obj, VALUE flags)
Sets the given flag(s).
Definition fl_type.h:658
RB_OBJ_INFECT_RAW
static void RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
Definition fl_type.h:868
RB_FL_REVERSE
static void RB_FL_REVERSE(VALUE obj, VALUE flags)
Reverses the flags.
Definition fl_type.h:769
RB_FL_UNSET
static void RB_FL_UNSET(VALUE obj, VALUE flags)
Clears the given flag(s).
Definition fl_type.h:713
RB_OBJ_FREEZE_RAW
static void RB_OBJ_FREEZE_RAW(VALUE obj)
This is an implenentation detail of RB_OBJ_FREEZE().
Definition fl_type.h:939
RB_FL_REVERSE_RAW
static void RB_FL_REVERSE_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_REVERSE().
Definition fl_type.h:753
RB_FL_ALL_RAW
static bool RB_FL_ALL_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_ALL().
Definition fl_type.h:584
ruby_fl_type
ruby_fl_type
The flags.
Definition fl_type.h:193
RUBY_FL_PROMOTED1
@ RUBY_FL_PROMOTED1
This flag has something to do with our garbage collector.
Definition fl_type.h:240
RUBY_ELTS_SHARED
@ RUBY_ELTS_SHARED
This flag has something to do with data structures.
Definition fl_type.h:405
RUBY_FL_SINGLETON
@ RUBY_FL_SINGLETON
This flag has something to do with an object's class.
Definition fl_type.h:430
RUBY_FL_TAINT
@ RUBY_FL_TAINT
Definition fl_type.h:278
RUBY_FL_WB_PROTECTED
@ RUBY_FL_WB_PROTECTED
Definition fl_type.h:207
RUBY_FL_PROMOTED0
@ RUBY_FL_PROMOTED0
This flag has something to do with our garbage collector.
Definition fl_type.h:223
RUBY_FL_EXIVAR
@ RUBY_FL_EXIVAR
This flag has something to do with instance variables.
Definition fl_type.h:345
RUBY_FL_UNTRUSTED
@ RUBY_FL_UNTRUSTED
Definition fl_type.h:305
RUBY_FL_PROMOTED
@ RUBY_FL_PROMOTED
This flag has something to do with our garbage collector.
Definition fl_type.h:257
RUBY_FL_USER0
@ RUBY_FL_USER0
User-defined flag.
Definition fl_type.h:360
RUBY_FL_FREEZE
@ RUBY_FL_FREEZE
This flag has something to do with data immutability.
Definition fl_type.h:356
RUBY_FL_SEEN_OBJ_ID
@ RUBY_FL_SEEN_OBJ_ID
This flag has something to do with object IDs.
Definition fl_type.h:332
RUBY_FL_USER2
@ RUBY_FL_USER2
User-defined flag.
Definition fl_type.h:362
RUBY_FL_SHAREABLE
@ RUBY_FL_SHAREABLE
This flag has something to do with Ractor.
Definition fl_type.h:298
RUBY_FL_FINALIZE
@ RUBY_FL_FINALIZE
This flag has something to do with finalisers.
Definition fl_type.h:271
RB_OBJ_TAINT_RAW
static void RB_OBJ_TAINT_RAW(VALUE obj)
Definition fl_type.h:837
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:359
RB_OBJ_TAINT
static void RB_OBJ_TAINT(VALUE obj)
Definition fl_type.h:852
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 klass)
This is an implementation detail of RB_OBJ_FREEZE().
Definition class.c:2207
noalias.h
Defines RBIMPL_ATTR_NOALIAS.
RBIMPL_ATTR_NOALIAS
#define RBIMPL_ATTR_NOALIAS()
Wraps (or simulates) __declspec((noalias))
Definition noalias.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.
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:375
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