aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-06-08 10:28:16 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-06-08 10:28:16 -0400
commitd9ef326d291189128c92fefaa9aa2217cd06e9a8 (patch)
tree621c998be8720b1da0d04b5a170aabd680e6ce80 /hash.c
parent3fe09eba9d040d275d8305fe1b00f2f22218b6c8 (diff)
downloadruby-d9ef326d291189128c92fefaa9aa2217cd06e9a8.tar.gz
[DOC] Add comment about flags for Hash
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 0aab4443df..29107b6b02 100644
--- a/hash.c
+++ b/hash.c
@@ -49,6 +49,23 @@
#include "ruby/ractor.h"
#include "vm_sync.h"
+/* Flags of RHash
+ *
+ * 1: RHASH_PASS_AS_KEYWORDS
+ * The hash is flagged as Ruby 2 keywords hash.
+ * 2: RHASH_PROC_DEFAULT
+ * The hash has a default proc (rather than a default value).
+ * 3: RHASH_ST_TABLE_FLAG
+ * The hash uses a ST table (rather than an AR table).
+ * 4-7: RHASH_AR_TABLE_SIZE_MASK
+ * The size of the AR table.
+ * 8-11: RHASH_AR_TABLE_BOUND_MASK
+ * The bounds of the AR table.
+ * 13-19: RHASH_LEV_MASK
+ * The iterational level of the hash. Used to prevent modifications
+ * to the hash during interation.
+ */
+
#ifndef HASH_DEBUG
#define HASH_DEBUG 0
#endif