aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-04-18 13:25:01 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-04-20 16:53:13 -0400
commitae90fa981a18119a06b152bfec203e902aeed3b9 (patch)
treebff622ae0e852f8600350e5d4c32d480e39c3274
parent277098bde2353e408ff4195d5cad387f0739b83c (diff)
downloadruby-ae90fa981a18119a06b152bfec203e902aeed3b9.tar.gz
[DOC] Documentation for flags of RClass
-rw-r--r--class.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/class.c b/class.c
index 1ae235d6ab..114df2bbd7 100644
--- a/class.c
+++ b/class.c
@@ -30,6 +30,42 @@
#include "ruby/st.h"
#include "vm_core.h"
+/* Flags of T_CLASS
+ *
+ * 2: RCLASS_SUPERCLASSES_INCLUDE_SELF
+ * The RCLASS_SUPERCLASSES contains the class as the last element.
+ * This means that this class owns the RCLASS_SUPERCLASSES list.
+ * if !SHAPE_IN_BASIC_FLAGS
+ * 4-19: SHAPE_FLAG_MASK
+ * Shape ID for the class.
+ * endif
+ */
+
+/* Flags of T_ICLASS
+ *
+ * 0: RICLASS_IS_ORIGIN
+ * 3: RICLASS_ORIGIN_SHARED_MTBL
+ * The T_ICLASS does not own the method table.
+ * if !SHAPE_IN_BASIC_FLAGS
+ * 4-19: SHAPE_FLAG_MASK
+ * Shape ID. This is set but not used.
+ * endif
+ */
+
+/* Flags of T_MODULE
+ *
+ * 1: RMODULE_ALLOCATED_BUT_NOT_INITIALIZED
+ * Module has not been initialized.
+ * 2: RCLASS_SUPERCLASSES_INCLUDE_SELF
+ * See RCLASS_SUPERCLASSES_INCLUDE_SELF in T_CLASS.
+ * 3: RMODULE_IS_REFINEMENT
+ * Module is used for refinements.
+ * if !SHAPE_IN_BASIC_FLAGS
+ * 4-19: SHAPE_FLAG_MASK
+ * Shape ID for the module.
+ * endif
+ */
+
#define METACLASS_OF(k) RBASIC(k)->klass
#define SET_METACLASS_OF(k, cls) RBASIC_SET_CLASS(k, cls)