datadog-ruby_core_source 3.4.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/id.h +357 -0
  3. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/id_table.h +15 -0
  4. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/array.h +2 -0
  5. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/basic_operators.h +66 -0
  6. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bignum.h +256 -0
  7. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bits.h +647 -0
  8. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/box.h +83 -0
  9. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/class.h +806 -0
  10. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/cmdlineopt.h +3 -0
  11. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/concurrent_set.h +21 -0
  12. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/cont.h +34 -0
  13. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/encoding.h +2 -1
  14. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/error.h +7 -0
  15. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/eval.h +43 -0
  16. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/gc.h +360 -0
  17. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/hash.h +1 -0
  18. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/imemo.h +87 -22
  19. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/inits.h +4 -0
  20. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/io.h +25 -5
  21. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/load.h +2 -0
  22. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/numeric.h +323 -0
  23. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/object.h +1 -1
  24. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/re.h +5 -0
  25. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/sanitizers.h +16 -0
  26. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/set_table.h +70 -0
  27. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/signal.h +1 -0
  28. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/st.h +1 -1
  29. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/string.h +4 -0
  30. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/struct.h +41 -0
  31. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/symbol.h +4 -5
  32. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/thread.h +112 -0
  33. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/time.h +34 -0
  34. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/variable.h +13 -9
  35. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/vm.h +138 -0
  36. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal.h +0 -3
  37. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/iseq.h +359 -0
  38. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/method.h +276 -0
  39. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/ast.h +8254 -0
  40. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/diagnostic.h +7 -0
  41. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/extension.h +1 -1
  42. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/options.h +488 -0
  43. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/parser.h +3 -0
  44. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/prism.h +408 -0
  45. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/regexp.h +2 -2
  46. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_buffer.h +8 -0
  47. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_integer.h +4 -0
  48. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_list.h +6 -0
  49. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_string.h +12 -2
  50. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/version.h +2 -2
  51. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism_compile.h +1 -0
  52. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ractor_core.h +63 -114
  53. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/ruby_atomic.h +73 -0
  54. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/rubyparser.h +1393 -0
  55. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/shape.h +464 -0
  56. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/thread_pthread.h +177 -0
  57. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_core.h +2406 -0
  58. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_debug.h +124 -0
  59. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/build_assert/build_assert.h +40 -0
  60. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/check_type/check_type.h +63 -0
  61. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/container_of/container_of.h +142 -0
  62. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/list/list.h +791 -0
  63. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/str/str.h +17 -0
  64. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/id.h +7 -5
  65. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/id_table.h +54 -0
  66. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/array.h +154 -0
  67. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/bignum.h +1 -0
  68. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
  69. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
  70. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/cmdlineopt.h +64 -0
  71. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compar.h +29 -0
  72. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compile.h +34 -0
  73. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compilers.h +107 -0
  74. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/complex.h +29 -0
  75. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
  76. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/dir.h +16 -0
  77. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enc.h +19 -0
  78. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/encoding.h +39 -0
  79. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enum.h +18 -0
  80. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enumerator.h +21 -0
  81. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/error.h +251 -0
  82. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/eval.h +8 -0
  83. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/file.h +38 -0
  84. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/fixnum.h +185 -0
  85. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/gc.h +25 -0
  86. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/hash.h +194 -0
  87. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/imemo.h +322 -0
  88. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/inits.h +51 -0
  89. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/io.h +163 -0
  90. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/load.h +20 -0
  91. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/loadpath.h +16 -0
  92. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/math.h +23 -0
  93. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/missing.h +19 -0
  94. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/numeric.h +1 -0
  95. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/object.h +63 -0
  96. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/parse.h +131 -0
  97. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/proc.h +30 -0
  98. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/process.h +124 -0
  99. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ractor.h +10 -0
  100. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/random.h +17 -0
  101. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/range.h +40 -0
  102. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/rational.h +71 -0
  103. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/re.h +33 -0
  104. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ruby_parser.h +102 -0
  105. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/sanitizers.h +346 -0
  106. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/serial.h +23 -0
  107. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
  108. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/signal.h +25 -0
  109. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/st.h +11 -0
  110. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/static_assert.h +16 -0
  111. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/string.h +203 -0
  112. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/struct.h +160 -0
  113. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/symbol.h +46 -0
  114. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/thread.h +14 -10
  115. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/transcode.h +23 -0
  116. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/util.h +27 -0
  117. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/variable.h +74 -0
  118. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/vm.h +3 -4
  119. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/warnings.h +16 -0
  120. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal.h +105 -0
  121. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/iseq.h +7 -1
  122. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/method.h +14 -1
  123. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/node.h +122 -0
  124. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_st.h +162 -0
  125. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_value.h +106 -0
  126. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/ast.h +322 -53
  127. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/defines.h +260 -0
  128. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/diagnostic.h +458 -0
  129. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/encoding.h +283 -0
  130. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/extension.h +19 -0
  131. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/node.h +129 -0
  132. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/options.h +46 -3
  133. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/pack.h +163 -0
  134. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/parser.h +936 -0
  135. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/prettyprint.h +34 -0
  136. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/prism.h +39 -14
  137. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
  138. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/static_literals.h +121 -0
  139. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_buffer.h +236 -0
  140. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_char.h +204 -0
  141. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_constant_pool.h +218 -0
  142. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_integer.h +130 -0
  143. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_list.h +103 -0
  144. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_memchr.h +29 -0
  145. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_newline_list.h +113 -0
  146. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_string.h +200 -0
  147. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strncasecmp.h +32 -0
  148. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strpbrk.h +46 -0
  149. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/version.h +29 -0
  150. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism_compile.h +106 -0
  151. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ractor_core.h +306 -0
  152. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_assert.h +14 -0
  153. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
  154. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/rubyparser.h +15 -1
  155. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
  156. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/thread_none.h +21 -0
  157. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/thread_pthread.h +10 -2
  158. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/vm_core.h +160 -45
  159. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h +67 -0
  160. data/lib/datadog/ruby_core_source/version.rb +1 -1
  161. data/lib/datadog/ruby_core_source.rb +1 -1
  162. metadata +214 -106
  163. data/CHANGELOG.datadog.md +0 -19
  164. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/class.h +0 -283
  165. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ruby_atomic.h +0 -23
  166. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/shape.h +0 -234
  167. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  168. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/check_type/check_type.h +0 -0
  169. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/container_of/container_of.h +0 -0
  170. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/list/list.h +0 -0
  171. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/str/str.h +0 -0
  172. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compar.h +0 -0
  173. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compile.h +0 -0
  174. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compilers.h +0 -0
  175. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/complex.h +0 -0
  176. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/dir.h +0 -0
  177. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enc.h +0 -0
  178. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enum.h +0 -0
  179. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enumerator.h +0 -0
  180. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/file.h +0 -0
  181. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/fixnum.h +0 -0
  182. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/loadpath.h +0 -0
  183. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/math.h +0 -0
  184. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/missing.h +0 -0
  185. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/parse.h +0 -0
  186. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/proc.h +0 -0
  187. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/process.h +0 -0
  188. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ractor.h +0 -0
  189. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/random.h +0 -0
  190. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/range.h +0 -0
  191. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/rational.h +0 -0
  192. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ruby_parser.h +0 -0
  193. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/serial.h +0 -0
  194. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/static_assert.h +0 -0
  195. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/transcode.h +0 -0
  196. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/util.h +0 -0
  197. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/warnings.h +0 -0
  198. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/node.h +0 -0
  199. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_st.h +0 -0
  200. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_value.h +0 -0
  201. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/defines.h +0 -0
  202. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/encoding.h +0 -0
  203. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/node.h +0 -0
  204. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/pack.h +0 -0
  205. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prettyprint.h +0 -0
  206. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/static_literals.h +0 -0
  207. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_char.h +0 -0
  208. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_constant_pool.h +0 -0
  209. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_memchr.h +0 -0
  210. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_newline_list.h +0 -0
  211. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strncasecmp.h +0 -0
  212. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strpbrk.h +0 -0
  213. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ruby_assert.h +0 -0
  214. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/thread_none.h +0 -0
  215. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_opts.h +0 -0
  216. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/basic_operators.h +0 -0
  217. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/bits.h +0 -0
  218. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/cont.h +0 -0
  219. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/time.h +0 -0
  220. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/vm_debug.h +0 -0
@@ -0,0 +1,38 @@
1
+ #ifndef INTERNAL_FILE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_FILE_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for File.
10
+ */
11
+ #include "ruby/ruby.h" /* for VALUE */
12
+ #include "ruby/encoding.h" /* for rb_encodinng */
13
+
14
+ /* file.c */
15
+ extern const char ruby_null_device[];
16
+ VALUE rb_home_dir_of(VALUE user, VALUE result);
17
+ VALUE rb_default_home_dir(VALUE result);
18
+ VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
19
+ VALUE rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *origenc);
20
+ void rb_file_const(const char*, VALUE);
21
+ int rb_file_load_ok(const char *);
22
+ VALUE rb_file_expand_path_fast(VALUE, VALUE);
23
+ VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
24
+ VALUE rb_get_path_check_to_string(VALUE);
25
+ VALUE rb_get_path_check_convert(VALUE);
26
+ int ruby_is_fd_loadable(int fd);
27
+
28
+ RUBY_SYMBOL_EXPORT_BEGIN
29
+ /* file.c (export) */
30
+ #ifdef HAVE_READLINK
31
+ VALUE rb_readlink(VALUE path, rb_encoding *enc);
32
+ #endif
33
+ #ifdef __APPLE__
34
+ VALUE rb_str_normalize_ospath(const char *ptr, long len);
35
+ #endif
36
+ RUBY_SYMBOL_EXPORT_END
37
+
38
+ #endif /* INTERNAL_FILE_H */
@@ -0,0 +1,185 @@
1
+ #ifndef INTERNAL_FIXNUM_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_FIXNUM_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Fixnums.
10
+ */
11
+ #include "ruby/internal/config.h" /* for HAVE_LONG_LONG */
12
+ #include <limits.h> /* for CHAR_BIT */
13
+ #include "internal/bits.h" /* for MUL_OVERFLOW_FIXNUM_P */
14
+ #include "internal/compilers.h" /* for __has_builtin */
15
+ #include "ruby/internal/stdbool.h" /* for bool */
16
+ #include "ruby/intern.h" /* for rb_big_mul */
17
+ #include "ruby/ruby.h" /* for RB_FIXABLE */
18
+
19
+ #if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG
20
+ # define DLONG LONG_LONG
21
+ # define DL2NUM(x) LL2NUM(x)
22
+ #elif defined(HAVE_INT128_T) && !(defined(__OpenBSD__) && defined(__mips64__))
23
+ # define DLONG int128_t
24
+ # define DL2NUM(x) (RB_FIXABLE(x) ? LONG2FIX(x) : rb_int128t2big(x))
25
+ VALUE rb_int128t2big(int128_t n); /* in bignum.c */
26
+ #endif
27
+
28
+ static inline long rb_overflowed_fix_to_int(long x);
29
+ static inline VALUE rb_fix_plus_fix(VALUE x, VALUE y);
30
+ static inline VALUE rb_fix_minus_fix(VALUE x, VALUE y);
31
+ static inline VALUE rb_fix_mul_fix(VALUE x, VALUE y);
32
+ static inline void rb_fix_divmod_fix(VALUE x, VALUE y, VALUE *divp, VALUE *modp);
33
+ static inline VALUE rb_fix_div_fix(VALUE x, VALUE y);
34
+ static inline VALUE rb_fix_mod_fix(VALUE x, VALUE y);
35
+ static inline bool FIXNUM_POSITIVE_P(VALUE num);
36
+ static inline bool FIXNUM_NEGATIVE_P(VALUE num);
37
+ static inline bool FIXNUM_ZERO_P(VALUE num);
38
+
39
+ static inline long
40
+ rb_overflowed_fix_to_int(long x)
41
+ {
42
+ return (long)((unsigned long)(x >> 1) ^ (1LU << (SIZEOF_LONG * CHAR_BIT - 1)));
43
+ }
44
+
45
+ static inline VALUE
46
+ rb_fix_plus_fix(VALUE x, VALUE y)
47
+ {
48
+ #if !__has_builtin(__builtin_add_overflow)
49
+ long lz = FIX2LONG(x) + FIX2LONG(y);
50
+ return LONG2NUM(lz);
51
+ #else
52
+ long lz;
53
+ /* NOTE
54
+ * (1) `LONG2FIX(FIX2LONG(x)+FIX2LONG(y))`
55
+ + = `((lx*2+1)/2 + (ly*2+1)/2)*2+1`
56
+ + = `lx*2 + ly*2 + 1`
57
+ + = `(lx*2+1) + (ly*2+1) - 1`
58
+ + = `x + y - 1`
59
+ * (2) Fixnum's LSB is always 1.
60
+ * It means you can always run `x - 1` without overflow.
61
+ * (3) Of course `z = x + (y-1)` may overflow.
62
+ * At that time true value is
63
+ * * positive: 0b0 1xxx...1, and z = 0b1xxx...1
64
+ * * negative: 0b1 0xxx...1, and z = 0b0xxx...1
65
+ * To convert this true value to long,
66
+ * (a) Use arithmetic shift
67
+ * * positive: 0b11xxx...
68
+ * * negative: 0b00xxx...
69
+ * (b) invert MSB
70
+ * * positive: 0b01xxx...
71
+ * * negative: 0b10xxx...
72
+ */
73
+ if (__builtin_add_overflow((long)x, (long)y-1, &lz)) {
74
+ return rb_int2big(rb_overflowed_fix_to_int(lz));
75
+ }
76
+ else {
77
+ return (VALUE)lz;
78
+ }
79
+ #endif
80
+ }
81
+
82
+ static inline VALUE
83
+ rb_fix_minus_fix(VALUE x, VALUE y)
84
+ {
85
+ #if !__has_builtin(__builtin_sub_overflow)
86
+ long lz = FIX2LONG(x) - FIX2LONG(y);
87
+ return LONG2NUM(lz);
88
+ #else
89
+ long lz;
90
+ if (__builtin_sub_overflow((long)x, (long)y-1, &lz)) {
91
+ return rb_int2big(rb_overflowed_fix_to_int(lz));
92
+ }
93
+ else {
94
+ return (VALUE)lz;
95
+ }
96
+ #endif
97
+ }
98
+
99
+ /* arguments must be Fixnum */
100
+ static inline VALUE
101
+ rb_fix_mul_fix(VALUE x, VALUE y)
102
+ {
103
+ long lx = FIX2LONG(x);
104
+ long ly = FIX2LONG(y);
105
+ #ifdef DLONG
106
+ return DL2NUM((DLONG)lx * (DLONG)ly);
107
+ #else
108
+ if (MUL_OVERFLOW_FIXNUM_P(lx, ly)) {
109
+ return rb_big_mul(rb_int2big(lx), rb_int2big(ly));
110
+ }
111
+ else {
112
+ return LONG2FIX(lx * ly);
113
+ }
114
+ #endif
115
+ }
116
+
117
+ /*
118
+ * This behaves different from C99 for negative arguments.
119
+ * Note that div may overflow fixnum.
120
+ */
121
+ static inline void
122
+ rb_fix_divmod_fix(VALUE a, VALUE b, VALUE *divp, VALUE *modp)
123
+ {
124
+ /* assume / and % comply C99.
125
+ * ldiv(3) won't be inlined by GCC and clang.
126
+ * I expect / and % are compiled as single idiv.
127
+ */
128
+ long x = FIX2LONG(a);
129
+ long y = FIX2LONG(b);
130
+ long div, mod;
131
+ if (x == FIXNUM_MIN && y == -1) {
132
+ if (divp) *divp = LONG2NUM(-FIXNUM_MIN);
133
+ if (modp) *modp = LONG2FIX(0);
134
+ return;
135
+ }
136
+ div = x / y;
137
+ mod = x % y;
138
+ if (y > 0 ? mod < 0 : mod > 0) {
139
+ mod += y;
140
+ div -= 1;
141
+ }
142
+ if (divp) *divp = LONG2FIX(div);
143
+ if (modp) *modp = LONG2FIX(mod);
144
+ }
145
+
146
+ /* div() for Ruby
147
+ * This behaves different from C99 for negative arguments.
148
+ */
149
+ static inline VALUE
150
+ rb_fix_div_fix(VALUE x, VALUE y)
151
+ {
152
+ VALUE div;
153
+ rb_fix_divmod_fix(x, y, &div, NULL);
154
+ return div;
155
+ }
156
+
157
+ /* mod() for Ruby
158
+ * This behaves different from C99 for negative arguments.
159
+ */
160
+ static inline VALUE
161
+ rb_fix_mod_fix(VALUE x, VALUE y)
162
+ {
163
+ VALUE mod;
164
+ rb_fix_divmod_fix(x, y, NULL, &mod);
165
+ return mod;
166
+ }
167
+
168
+ static inline bool
169
+ FIXNUM_POSITIVE_P(VALUE num)
170
+ {
171
+ return (SIGNED_VALUE)num > (SIGNED_VALUE)INT2FIX(0);
172
+ }
173
+
174
+ static inline bool
175
+ FIXNUM_NEGATIVE_P(VALUE num)
176
+ {
177
+ return (SIGNED_VALUE)num < 0;
178
+ }
179
+
180
+ static inline bool
181
+ FIXNUM_ZERO_P(VALUE num)
182
+ {
183
+ return num == INT2FIX(0);
184
+ }
185
+ #endif /* INTERNAL_FIXNUM_H */
@@ -201,6 +201,7 @@ RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t);
201
201
  static inline void *ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
202
202
  static inline void *ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
203
203
  static inline void ruby_sized_xfree_inlined(void *ptr, size_t size);
204
+ void rb_gc_obj_id_moved(VALUE obj);
204
205
 
205
206
  void *rb_gc_ractor_cache_alloc(rb_ractor_t *ractor);
206
207
  void rb_gc_ractor_cache_free(void *cache);
@@ -263,6 +264,26 @@ int rb_gc_modular_gc_loaded_p(void);
263
264
 
264
265
  RUBY_SYMBOL_EXPORT_END
265
266
 
267
+ static inline VALUE
268
+ rb_obj_atomic_write(
269
+ VALUE a, VALUE *slot, VALUE b,
270
+ RBIMPL_ATTR_MAYBE_UNUSED()
271
+ const char *filename,
272
+ RBIMPL_ATTR_MAYBE_UNUSED()
273
+ int line)
274
+ {
275
+ #ifdef RGENGC_LOGGING_WRITE
276
+ RGENGC_LOGGING_WRITE(a, slot, b, filename, line);
277
+ #endif
278
+
279
+ RUBY_ATOMIC_VALUE_SET(*slot, b);
280
+
281
+ rb_obj_written(a, RUBY_Qundef /* ignore `oldv' now */, b, filename, line);
282
+ return a;
283
+ }
284
+ #define RB_OBJ_ATOMIC_WRITE(old, slot, young) \
285
+ RBIMPL_CAST(rb_obj_atomic_write((VALUE)(old), (VALUE *)(slot), (VALUE)(young), __FILE__, __LINE__))
286
+
266
287
  int rb_ec_stack_check(struct rb_execution_context_struct *ec);
267
288
  void rb_gc_writebarrier_remember(VALUE obj);
268
289
  const char *rb_obj_info(VALUE obj);
@@ -330,4 +351,8 @@ ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t ol
330
351
  #define ruby_sized_xrealloc ruby_sized_xrealloc_inlined
331
352
  #define ruby_sized_xrealloc2 ruby_sized_xrealloc2_inlined
332
353
  #define ruby_sized_xfree ruby_sized_xfree_inlined
354
+
355
+ void rb_gc_verify_shareable(VALUE);
356
+ bool rb_gc_checking_shareable(void);
357
+
333
358
  #endif /* INTERNAL_GC_H */
@@ -0,0 +1,194 @@
1
+ #ifndef INTERNAL_HASH_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_HASH_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Hash.
10
+ */
11
+ #include "ruby/internal/config.h"
12
+ #include <stddef.h> /* for size_t */
13
+ #include "ruby/internal/stdbool.h" /* for bool */
14
+ #include "ruby/ruby.h" /* for struct RBasic */
15
+ #include "ruby/st.h" /* for struct st_table */
16
+
17
+ #define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE
18
+
19
+ struct ar_table_struct;
20
+ typedef unsigned char ar_hint_t;
21
+
22
+ enum ruby_rhash_flags {
23
+ RHASH_PASS_AS_KEYWORDS = FL_USER1, /* FL 1 */
24
+ RHASH_PROC_DEFAULT = FL_USER2, /* FL 2 */
25
+ RHASH_ST_TABLE_FLAG = FL_USER3, /* FL 3 */
26
+ RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7), /* FL 4..7 */
27
+ RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4),
28
+ RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */
29
+ RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8),
30
+
31
+ // we can not put it in "enum" because it can exceed "int" range.
32
+ #define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \
33
+ FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19)
34
+
35
+ RHASH_LEV_SHIFT = (FL_USHIFT + 13),
36
+ RHASH_LEV_MAX = 127, /* 7 bits */
37
+ };
38
+
39
+ typedef struct ar_table_pair_struct {
40
+ VALUE key;
41
+ VALUE val;
42
+ } ar_table_pair;
43
+
44
+ typedef struct ar_table_struct {
45
+ union {
46
+ ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE];
47
+ VALUE word;
48
+ } ar_hint;
49
+ /* 64bit CPU: 8B * 2 * 8 = 128B */
50
+ ar_table_pair pairs[RHASH_AR_TABLE_MAX_SIZE];
51
+ } ar_table;
52
+
53
+ struct RHash {
54
+ struct RBasic basic;
55
+ const VALUE ifnone;
56
+ };
57
+
58
+ #define RHASH(obj) ((struct RHash *)(obj))
59
+
60
+ #ifdef RHASH_IFNONE
61
+ # undef RHASH_IFNONE
62
+ #endif
63
+
64
+ #ifdef RHASH_SIZE
65
+ # undef RHASH_SIZE
66
+ #endif
67
+
68
+ #ifdef RHASH_EMPTY_P
69
+ # undef RHASH_EMPTY_P
70
+ #endif
71
+
72
+ /* hash.c */
73
+ void rb_hash_st_table_set(VALUE hash, st_table *st);
74
+ VALUE rb_hash_default_value(VALUE hash, VALUE key);
75
+ VALUE rb_hash_set_default(VALUE hash, VALUE ifnone);
76
+ VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc);
77
+ long rb_dbl_long_hash(double d);
78
+ st_table *rb_init_identtable(void);
79
+ st_index_t rb_any_hash(VALUE a);
80
+ int rb_any_cmp(VALUE a, VALUE b);
81
+ VALUE rb_to_hash_type(VALUE obj);
82
+ VALUE rb_hash_key_str(VALUE);
83
+ VALUE rb_hash_values(VALUE hash);
84
+ VALUE rb_hash_rehash(VALUE hash);
85
+ int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val);
86
+ VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
87
+ int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
88
+ int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
89
+ int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg);
90
+ bool rb_hash_default_unredefined(VALUE hash);
91
+ VALUE rb_ident_hash_new_with_size(st_index_t size);
92
+ void rb_hash_free(VALUE hash);
93
+ RUBY_EXTERN VALUE rb_cHash_empty_frozen;
94
+
95
+ static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
96
+ static inline VALUE RHASH_IFNONE(VALUE h);
97
+ static inline size_t RHASH_SIZE(VALUE h);
98
+ static inline bool RHASH_EMPTY_P(VALUE h);
99
+ static inline bool RHASH_AR_TABLE_P(VALUE h);
100
+ static inline bool RHASH_ST_TABLE_P(VALUE h);
101
+ static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h);
102
+ static inline st_table *RHASH_ST_TABLE(VALUE h);
103
+ static inline size_t RHASH_ST_SIZE(VALUE h);
104
+ static inline void RHASH_ST_CLEAR(VALUE h);
105
+
106
+ RUBY_SYMBOL_EXPORT_BEGIN
107
+ /* hash.c (export) */
108
+ VALUE rb_hash_delete_entry(VALUE hash, VALUE key);
109
+ VALUE rb_ident_hash_new(void);
110
+ int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg);
111
+ RUBY_SYMBOL_EXPORT_END
112
+
113
+ VALUE rb_hash_new_with_size(st_index_t size);
114
+ VALUE rb_hash_resurrect(VALUE hash);
115
+ int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval);
116
+ VALUE rb_hash_keys(VALUE hash);
117
+ VALUE rb_hash_has_key(VALUE hash, VALUE key);
118
+ VALUE rb_hash_compare_by_id_p(VALUE hash);
119
+
120
+ st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line);
121
+ #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__)
122
+
123
+ VALUE rb_hash_compare_by_id(VALUE hash);
124
+
125
+ static inline bool
126
+ RHASH_AR_TABLE_P(VALUE h)
127
+ {
128
+ return ! FL_TEST_RAW(h, RHASH_ST_TABLE_FLAG);
129
+ }
130
+
131
+ RBIMPL_ATTR_RETURNS_NONNULL()
132
+ static inline struct ar_table_struct *
133
+ RHASH_AR_TABLE(VALUE h)
134
+ {
135
+ return (struct ar_table_struct *)((uintptr_t)h + sizeof(struct RHash));
136
+ }
137
+
138
+ RBIMPL_ATTR_RETURNS_NONNULL()
139
+ static inline st_table *
140
+ RHASH_ST_TABLE(VALUE h)
141
+ {
142
+ return (st_table *)((uintptr_t)h + sizeof(struct RHash));
143
+ }
144
+
145
+ static inline VALUE
146
+ RHASH_IFNONE(VALUE h)
147
+ {
148
+ return RHASH(h)->ifnone;
149
+ }
150
+
151
+ static inline size_t
152
+ RHASH_SIZE(VALUE h)
153
+ {
154
+ if (RHASH_AR_TABLE_P(h)) {
155
+ return RHASH_AR_TABLE_SIZE_RAW(h);
156
+ }
157
+ else {
158
+ return RHASH_ST_SIZE(h);
159
+ }
160
+ }
161
+
162
+ static inline bool
163
+ RHASH_EMPTY_P(VALUE h)
164
+ {
165
+ return RHASH_SIZE(h) == 0;
166
+ }
167
+
168
+ static inline bool
169
+ RHASH_ST_TABLE_P(VALUE h)
170
+ {
171
+ return ! RHASH_AR_TABLE_P(h);
172
+ }
173
+
174
+ static inline size_t
175
+ RHASH_ST_SIZE(VALUE h)
176
+ {
177
+ return RHASH_ST_TABLE(h)->num_entries;
178
+ }
179
+
180
+ static inline void
181
+ RHASH_ST_CLEAR(VALUE h)
182
+ {
183
+ memset(RHASH_ST_TABLE(h), 0, sizeof(st_table));
184
+ }
185
+
186
+ static inline unsigned
187
+ RHASH_AR_TABLE_SIZE_RAW(VALUE h)
188
+ {
189
+ VALUE ret = FL_TEST_RAW(h, RHASH_AR_TABLE_SIZE_MASK);
190
+ ret >>= RHASH_AR_TABLE_SIZE_SHIFT;
191
+ return (unsigned)ret;
192
+ }
193
+
194
+ #endif /* INTERNAL_HASH_H */