datadog-ruby_core_source 3.5.4 → 3.5.6

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 (198) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/datadog-ruby_core_source.gemspec +1 -1
  4. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/build_assert/build_assert.h +40 -0
  5. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/check_type/check_type.h +63 -0
  6. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/container_of/container_of.h +142 -0
  7. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/list/list.h +788 -0
  8. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/str/str.h +16 -0
  9. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/id.h +252 -0
  10. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/internal.h +2465 -0
  11. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/iseq.h +304 -0
  12. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/method.h +229 -0
  13. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/node.h +449 -0
  14. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h +60 -0
  15. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ruby_atomic.h +244 -0
  16. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/thread_pthread.h +75 -0
  17. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/thread_win32.h +36 -0
  18. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/vm_core.h +1902 -0
  19. data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/vm_opts.h +70 -0
  20. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/build_assert/build_assert.h +40 -0
  21. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/check_type/check_type.h +63 -0
  22. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/container_of/container_of.h +142 -0
  23. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/list/list.h +788 -0
  24. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/str/str.h +16 -0
  25. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/id.h +290 -0
  26. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/internal.h +2697 -0
  27. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/iseq.h +312 -0
  28. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/method.h +229 -0
  29. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/node.h +476 -0
  30. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ruby_assert.h +15 -0
  31. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ruby_atomic.h +244 -0
  32. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/thread_pthread.h +75 -0
  33. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/thread_win32.h +36 -0
  34. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/vm_core.h +1968 -0
  35. data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/vm_opts.h +72 -0
  36. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/build_assert/build_assert.h +40 -0
  37. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/check_type/check_type.h +63 -0
  38. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/container_of/container_of.h +142 -0
  39. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/list/list.h +788 -0
  40. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/str/str.h +16 -0
  41. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/id.h +290 -0
  42. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/id_table.h +36 -0
  43. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
  44. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
  45. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
  46. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
  47. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
  48. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
  49. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
  50. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
  51. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
  52. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
  53. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/iseq.h +305 -0
  54. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/method.h +245 -0
  55. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/node.h +484 -0
  56. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
  57. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
  58. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
  59. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/thread_pthread.h +115 -0
  60. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/thread_win32.h +61 -0
  61. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/vm_core.h +2023 -0
  62. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
  63. data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/vm_opts.h +73 -0
  64. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/build_assert/build_assert.h +40 -0
  65. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/check_type/check_type.h +63 -0
  66. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/container_of/container_of.h +142 -0
  67. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/list/list.h +788 -0
  68. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/str/str.h +16 -0
  69. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/darray.h +198 -0
  70. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/id.h +293 -0
  71. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/id_table.h +36 -0
  72. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/array.h +113 -0
  73. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/class.h +196 -0
  74. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/compilers.h +107 -0
  75. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/gc.h +186 -0
  76. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h +243 -0
  77. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/serial.h +23 -0
  78. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/static_assert.h +16 -0
  79. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/vm.h +133 -0
  80. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/warnings.h +16 -0
  81. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal.h +109 -0
  82. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/iseq.h +322 -0
  83. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/method.h +253 -0
  84. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/node.h +510 -0
  85. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ractor_core.h +346 -0
  86. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ruby_assert.h +14 -0
  87. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ruby_atomic.h +23 -0
  88. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/thread_pthread.h +115 -0
  89. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/vm_core.h +2107 -0
  90. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/vm_debug.h +124 -0
  91. data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/vm_opts.h +73 -0
  92. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/build_assert/build_assert.h +40 -0
  93. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/check_type/check_type.h +63 -0
  94. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/container_of/container_of.h +142 -0
  95. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/list/list.h +789 -0
  96. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/str/str.h +17 -0
  97. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/id.h +299 -0
  98. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/id_table.h +39 -0
  99. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/array.h +163 -0
  100. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/basic_operators.h +64 -0
  101. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/class.h +182 -0
  102. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/compilers.h +107 -0
  103. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/gc.h +192 -0
  104. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/imemo.h +242 -0
  105. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/serial.h +23 -0
  106. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/static_assert.h +16 -0
  107. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/vm.h +134 -0
  108. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/warnings.h +16 -0
  109. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal.h +113 -0
  110. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/iseq.h +329 -0
  111. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/method.h +254 -0
  112. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/node.h +514 -0
  113. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ractor_core.h +342 -0
  114. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ruby_assert.h +14 -0
  115. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ruby_atomic.h +23 -0
  116. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/shape.h +232 -0
  117. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/thread_none.h +20 -0
  118. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/thread_pthread.h +133 -0
  119. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/vm_core.h +2106 -0
  120. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/vm_debug.h +122 -0
  121. data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/vm_opts.h +73 -0
  122. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ccan/build_assert/build_assert.h +40 -0
  123. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ccan/check_type/check_type.h +63 -0
  124. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ccan/container_of/container_of.h +142 -0
  125. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ccan/list/list.h +791 -0
  126. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ccan/str/str.h +17 -0
  127. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/constant.h +53 -0
  128. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/debug_counter.h +428 -0
  129. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/hrtime.h +237 -0
  130. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/id.h +365 -0
  131. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/id_table.h +74 -0
  132. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/array.h +158 -0
  133. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/basic_operators.h +67 -0
  134. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/bits.h +647 -0
  135. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/box.h +103 -0
  136. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/class.h +797 -0
  137. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/compilers.h +104 -0
  138. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/coverage.h +51 -0
  139. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/gc.h +411 -0
  140. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/imemo.h +302 -0
  141. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/sanitizers.h +346 -0
  142. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/serial.h +23 -0
  143. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/set_table.h +77 -0
  144. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/static_assert.h +16 -0
  145. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/time.h +34 -0
  146. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/variable.h +81 -0
  147. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/vm.h +144 -0
  148. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal/warnings.h +16 -0
  149. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/internal.h +106 -0
  150. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/iseq.h +439 -0
  151. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/method.h +279 -0
  152. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/node.h +122 -0
  153. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/parser_st.h +161 -0
  154. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/parser_value.h +116 -0
  155. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/arena.h +37 -0
  156. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/ast.h +10371 -0
  157. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/buffer.h +52 -0
  158. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/comments.h +43 -0
  159. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/align.h +36 -0
  160. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/exported.h +24 -0
  161. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/filesystem.h +32 -0
  162. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/nodiscard.h +22 -0
  163. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/nonnull.h +18 -0
  164. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/constant_pool.h +81 -0
  165. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/diagnostic.h +93 -0
  166. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/errors_format.h +53 -0
  167. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/excludes.h +29 -0
  168. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/integer.h +41 -0
  169. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/json.h +32 -0
  170. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/line_offset_list.h +61 -0
  171. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/magic_comments.h +35 -0
  172. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/node.h +94 -0
  173. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/options.h +335 -0
  174. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/parser.h +348 -0
  175. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/prettyprint.h +31 -0
  176. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/prism.h +131 -0
  177. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/serialize.h +115 -0
  178. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/source.h +155 -0
  179. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/stream.h +28 -0
  180. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/string_query.h +63 -0
  181. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/stringy.h +72 -0
  182. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism/version.h +38 -0
  183. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/prism_compile.h +204 -0
  184. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ractor_core.h +421 -0
  185. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ruby_assert.h +14 -0
  186. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/ruby_atomic.h +115 -0
  187. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/rubyparser.h +1389 -0
  188. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/shape.h +733 -0
  189. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/thread_none.h +25 -0
  190. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/thread_pthread.h +63 -0
  191. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/thread_sched.h +271 -0
  192. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/vm_core.h +2509 -0
  193. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/vm_debug.h +124 -0
  194. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/vm_opts.h +65 -0
  195. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/vm_sync.h +160 -0
  196. data/lib/datadog/ruby_core_source/ruby-4.1.0-preview1/zjit.h +221 -0
  197. data/lib/datadog/ruby_core_source/version.rb +1 -1
  198. metadata +197 -4
@@ -0,0 +1,104 @@
1
+ #ifndef INTERNAL_COMPILERS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPILERS_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 absorbing C compiler differences.
10
+ */
11
+ #include "ruby/internal/compiler_since.h"
12
+ #include "ruby/internal/has/attribute.h"
13
+ #include "ruby/internal/has/builtin.h"
14
+ #include "ruby/internal/has/c_attribute.h"
15
+ #include "ruby/internal/has/declspec_attribute.h"
16
+ #include "ruby/internal/has/extension.h"
17
+ #include "ruby/internal/has/feature.h"
18
+ #include "ruby/internal/has/warning.h"
19
+ #include "ruby/backward/2/gcc_version_since.h"
20
+
21
+ #ifndef __has_attribute
22
+ # define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__)
23
+ #endif
24
+
25
+ #ifndef __has_c_attribute
26
+ # /* As of writing everything that lacks __has_c_attribute also completely
27
+ # * lacks C2x attributes as well. Might change in future? */
28
+ # define __has_c_attribute(...) 0
29
+ #endif
30
+
31
+ #ifndef __has_declspec_attribute
32
+ # define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__)
33
+ #endif
34
+
35
+ #ifndef __has_builtin
36
+ # define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__)
37
+ #endif
38
+
39
+ #ifndef __has_feature
40
+ # define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__)
41
+ #endif
42
+
43
+ #ifndef __has_extension
44
+ # define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__)
45
+ #endif
46
+
47
+ #ifndef __has_warning
48
+ # define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__)
49
+ #endif
50
+
51
+ #ifndef __GNUC__
52
+ # define __extension__ /* void */
53
+ #endif
54
+
55
+ #ifndef MAYBE_UNUSED
56
+ # define MAYBE_UNUSED(x) x
57
+ #endif
58
+
59
+ #ifndef WARN_UNUSED_RESULT
60
+ # define WARN_UNUSED_RESULT(x) x
61
+ #endif
62
+
63
+ #define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
64
+ #define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
65
+ #ifdef __GNUC__
66
+ #define rb_obj_builtin_type(obj) \
67
+ __extension__({ \
68
+ VALUE arg_obj = (obj); \
69
+ RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
70
+ (int)RB_BUILTIN_TYPE(arg_obj); \
71
+ })
72
+ #else
73
+ # include "ruby/ruby.h"
74
+ static inline int
75
+ rb_obj_builtin_type(VALUE obj)
76
+ {
77
+ return RB_SPECIAL_CONST_P(obj) ? -1 :
78
+ (int)RB_BUILTIN_TYPE(obj);
79
+ }
80
+ #endif
81
+
82
+ /* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
83
+ #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(_MSC_VER)
84
+ # define FLEX_ARY_LEN /* VALUE ary[]; */
85
+ #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
86
+ # define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
87
+ #else
88
+ # define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
89
+ #endif
90
+
91
+ /*
92
+ * For declaring bitfields out of non-unsigned int types:
93
+ * struct date {
94
+ * BITFIELD(enum months, month, 4);
95
+ * ...
96
+ * };
97
+ */
98
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(_MSC_VER)
99
+ # define BITFIELD(type, name, size) type name : size
100
+ #else
101
+ # define BITFIELD(type, name, size) unsigned int name : size
102
+ #endif
103
+
104
+ #endif /* INTERNAL_COMPILERS_H */
@@ -0,0 +1,51 @@
1
+ #ifndef INTERNAL_COVERAGE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COVERAGE_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 Coverage.
10
+ */
11
+ #include "ruby/ruby.h"
12
+
13
+ #define COVERAGE_INDEX_LINES 0
14
+ #define COVERAGE_INDEX_BRANCHES 1
15
+
16
+ #define COVERAGE_TARGET_LINES 1
17
+ #define COVERAGE_TARGET_BRANCHES 2
18
+ #define COVERAGE_TARGET_METHODS 4
19
+ #define COVERAGE_TARGET_ONESHOT_LINES 8
20
+ #define COVERAGE_TARGET_EVAL 16
21
+
22
+ struct rb_coverage_method_data {
23
+ VALUE owner;
24
+ VALUE method_id;
25
+ VALUE path;
26
+ VALUE first_lineno;
27
+ VALUE first_column;
28
+ VALUE last_lineno;
29
+ VALUE last_column;
30
+ VALUE count;
31
+ };
32
+
33
+ typedef void rb_coverage_method_callback(const struct rb_coverage_method_data *, void *);
34
+
35
+ RUBY_SYMBOL_EXPORT_BEGIN
36
+
37
+ VALUE rb_get_coverages(void);
38
+ void rb_set_coverages(VALUE coverages, int mode, VALUE cme2counter, VALUE me_set);
39
+ void rb_clear_coverages(void);
40
+ void rb_reset_coverages(void);
41
+ void rb_resume_coverages(void);
42
+ void rb_suspend_coverages(void);
43
+ void rb_coverage_each_method(rb_coverage_method_callback callback, void *data);
44
+ bool rb_coverage_method_data_of(VALUE me, VALUE count, struct rb_coverage_method_data *out);
45
+
46
+ RUBY_SYMBOL_EXPORT_END
47
+
48
+ int rb_get_coverage_mode(void);
49
+ VALUE rb_default_coverage(int n);
50
+
51
+ #endif /* INTERNAL_COVERAGE_H */
@@ -0,0 +1,411 @@
1
+ #ifndef INTERNAL_GC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_GC_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 GC.
10
+ */
11
+ #include "ruby/internal/config.h"
12
+
13
+ #include <stddef.h> /* for size_t */
14
+
15
+ #include "internal/compilers.h" /* for __has_attribute */
16
+ #include "ruby/ruby.h" /* for rb_event_flag_t */
17
+ #include "ruby_atomic.h" /* for RUBY_ATOMIC_VALUE_SET */
18
+
19
+ struct rb_gc_zjit_fastpath;
20
+
21
+ #ifndef USE_MODULAR_GC
22
+ # define USE_MODULAR_GC 0
23
+ #endif
24
+
25
+ #if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__)
26
+ #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
27
+ #elif defined(__i386) && defined(__GNUC__)
28
+ #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p)))
29
+ #elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && !defined(_AIX)
30
+ #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p)))
31
+ #elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && defined(_AIX)
32
+ #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr %0,1" : "=r" (*(p)))
33
+ #elif defined(__aarch64__) && defined(__GNUC__)
34
+ #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mov\t%0, sp" : "=r" (*(p)))
35
+ #else
36
+ NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
37
+ #define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
38
+ #define USE_CONSERVATIVE_STACK_END
39
+ #endif
40
+
41
+ /* for GC debug */
42
+
43
+ #ifndef RUBY_MARK_FREE_DEBUG
44
+ #define RUBY_MARK_FREE_DEBUG 0
45
+ #endif
46
+
47
+ #if RUBY_MARK_FREE_DEBUG
48
+ extern int ruby_gc_debug_indent;
49
+
50
+ static inline void
51
+ rb_gc_debug_indent(void)
52
+ {
53
+ ruby_debug_printf("%*s", ruby_gc_debug_indent, "");
54
+ }
55
+
56
+ static inline void
57
+ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
58
+ {
59
+ if (st == 0) {
60
+ ruby_gc_debug_indent--;
61
+ }
62
+ rb_gc_debug_indent();
63
+ ruby_debug_printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr);
64
+
65
+ if (st) {
66
+ ruby_gc_debug_indent++;
67
+ }
68
+
69
+ fflush(stdout);
70
+ }
71
+
72
+ #define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", (msg), 1, ptr)
73
+ #define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", (msg), 0, ptr)
74
+ #define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", (msg), 1, ptr)
75
+ #define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", (msg), 0, ptr)
76
+ #define RUBY_GC_INFO rb_gc_debug_indent(), ruby_debug_printf
77
+
78
+ #else
79
+ #define RUBY_MARK_ENTER(msg)
80
+ #define RUBY_MARK_LEAVE(msg)
81
+ #define RUBY_FREE_ENTER(msg)
82
+ #define RUBY_FREE_LEAVE(msg)
83
+ #define RUBY_GC_INFO if(0)printf
84
+ #endif
85
+
86
+ #if STACK_GROW_DIRECTION > 0
87
+ # define STACK_UPPER(x, a, b) (a)
88
+ #elif STACK_GROW_DIRECTION < 0
89
+ # define STACK_UPPER(x, a, b) (b)
90
+ #else
91
+ RUBY_EXTERN int ruby_stack_grow_direction;
92
+ int ruby_get_stack_grow_direction(volatile VALUE *addr);
93
+ # define stack_growup_p(x) ( \
94
+ (ruby_stack_grow_direction ? \
95
+ ruby_stack_grow_direction : \
96
+ ruby_get_stack_grow_direction(x)) > 0)
97
+ # define STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b))
98
+ #endif
99
+
100
+ /*
101
+ STACK_GROW_DIR_DETECTION is used with STACK_DIR_UPPER.
102
+
103
+ On most normal systems, stacks grow from high address to lower address. In
104
+ this case, STACK_DIR_UPPER(a, b) will return (b), but on exotic systems where
105
+ the stack grows UP (from low address to high address), it will return (a).
106
+ */
107
+
108
+ #if STACK_GROW_DIRECTION
109
+ #define STACK_GROW_DIR_DETECTION
110
+ #define STACK_DIR_UPPER(a,b) STACK_UPPER(0, (a), (b))
111
+ #else
112
+ #define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
113
+ #define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b))
114
+ #endif
115
+ #define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
116
+
117
+ const char *rb_obj_info(VALUE obj);
118
+ const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj);
119
+
120
+ struct rb_execution_context_struct; /* in vm_core.h */
121
+ struct rb_objspace; /* in vm_core.h */
122
+ struct rb_ractor_struct; /* in vm_core.h */
123
+
124
+ #define EC_NEWOBJ_OF(var, T, c, f, s, ec) \
125
+ T *(var) = (T *)rb_ec_newobj_of((ec), (c), (f), s)
126
+ #define NEWOBJ_OF(var, T, c, f, s) EC_NEWOBJ_OF(var, T, c, f, s, GET_EC())
127
+ #define UNPROTECTED_NEWOBJ_OF(var, T, c, f, s) \
128
+ T *(var) = (T *)rb_newobj((GET_EC()), (c), (f), ROOT_SHAPE_ID | SHAPE_ID_LAYOUT_OTHER, false, s)
129
+
130
+ #ifndef RB_GC_OBJECT_METADATA_ENTRY_DEFINED
131
+ # define RB_GC_OBJECT_METADATA_ENTRY_DEFINED
132
+ struct rb_gc_object_metadata_entry {
133
+ ID name;
134
+ VALUE val;
135
+ };
136
+ #endif
137
+
138
+ #ifndef USE_UNALIGNED_MEMBER_ACCESS
139
+ # define UNALIGNED_MEMBER_ACCESS(expr) (expr)
140
+ #elif ! USE_UNALIGNED_MEMBER_ACCESS
141
+ # define UNALIGNED_MEMBER_ACCESS(expr) (expr)
142
+ #elif ! (__has_warning("-Waddress-of-packed-member") || GCC_VERSION_SINCE(9, 0, 0))
143
+ # define UNALIGNED_MEMBER_ACCESS(expr) (expr)
144
+ #else
145
+ # include "internal/warnings.h"
146
+ # define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
147
+ COMPILER_WARNING_PUSH; \
148
+ COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
149
+ __typeof__(expr) unaligned_member_access_result = (expr); \
150
+ COMPILER_WARNING_POP; \
151
+ unaligned_member_access_result; \
152
+ })
153
+
154
+ # define UNALIGNED_MEMBER_PTR(ptr, mem) __extension__({ \
155
+ COMPILER_WARNING_PUSH; \
156
+ COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
157
+ const volatile void *unaligned_member_ptr_result = &(ptr)->mem; \
158
+ COMPILER_WARNING_POP; \
159
+ (__typeof__((ptr)->mem) *)unaligned_member_ptr_result; \
160
+ })
161
+ #endif
162
+
163
+ #ifndef UNALIGNED_MEMBER_PTR
164
+ # define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
165
+ #endif
166
+
167
+ #define RB_OBJ_WRITE_UNALIGNED(old, slot, young) do { \
168
+ VALUE *_slot = UNALIGNED_MEMBER_ACCESS(slot); \
169
+ RB_OBJ_WRITE(old, _slot, young); \
170
+ } while (0)
171
+
172
+ /* Used in places that could malloc during, which can cause the GC to run. We
173
+ * need to temporarily disable the GC to allow the malloc to happen.
174
+ * Allocating memory during GC is a bad idea, so use this only when absolutely
175
+ * necessary. */
176
+ /* Only re-entrant GC of the current objspace needs suppressing (the malloc happens inside this
177
+ * Ractor), so use the local disable. The during-GC malloc guard reads the per-objspace dont_gc
178
+ * flag rather than a process-wide one. */
179
+ #define DURING_GC_COULD_MALLOC_REGION_START() \
180
+ assert(rb_during_gc()); \
181
+ VALUE _already_disabled = rb_gc_local_disable_no_rest()
182
+
183
+ #define DURING_GC_COULD_MALLOC_REGION_END() \
184
+ if (_already_disabled == Qfalse) rb_gc_local_enable()
185
+
186
+ /* gc.c */
187
+ RUBY_ATTR_MALLOC void *ruby_mimmalloc(size_t size);
188
+ RUBY_ATTR_MALLOC void *ruby_mimcalloc(size_t num, size_t size);
189
+ void ruby_mimfree(void *ptr);
190
+ void rb_gc_prepare_heap(void);
191
+ VALUE rb_wmap_new_hidden(void);
192
+ VALUE rb_wmap_lookup(VALUE wmap, VALUE key);
193
+ void rb_wmap_aset(VALUE wmap, VALUE key, VALUE val);
194
+ void rb_objspace_set_event_hook(const rb_event_flag_t event);
195
+ VALUE rb_objspace_gc_enable(void *objspace);
196
+ VALUE rb_objspace_gc_disable(void *objspace);
197
+ void ruby_gc_set_params(void);
198
+ void rb_gc_copy_attributes(VALUE dest, VALUE obj);
199
+ size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */
200
+ size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */
201
+ size_t rb_malloc_grow_capa(size_t current_capacity, size_t type_size);
202
+ RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add(size_t, size_t, size_t);
203
+ RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add(size_t, size_t, size_t);
204
+ void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t);
205
+ RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t);
206
+ RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t);
207
+ void rb_gc_register_pinning_obj(VALUE obj);
208
+ struct rb_execution_context_struct *rb_gc_get_ec(void);
209
+ VALUE rb_newobj_of_unprotected(VALUE klass, VALUE flags, size_t size);
210
+
211
+ void *rb_gc_ractor_cache_alloc(struct rb_ractor_struct *ractor);
212
+ void rb_gc_ractor_cache_free(void *cache);
213
+ bool rb_gc_zjit_new_obj_fastpath(size_t alloc_size, VALUE flags, VALUE klass, struct rb_gc_zjit_fastpath *fastpath);
214
+ const uintptr_t *rb_gc_zjit_writebarrier_required_p_ptr(void);
215
+
216
+ bool rb_gc_size_allocatable_p(size_t size);
217
+ size_t rb_gc_size_slot_size(size_t size);
218
+ size_t rb_gc_max_allocation_size(void);
219
+
220
+ void rb_gc_mark_and_move(VALUE *ptr);
221
+
222
+ /* The objspace a marking walk marks into, plus the per-Ractor traversal redirect slot
223
+ * (vm_core.h's gc_mark_func_data_struct) and the shareable-check flag cached from it.
224
+ * Resolving the current Ractor costs an out-of-line rb_current_ec() call on arm64, so a
225
+ * walk resolves it once into a ctx and threads that down instead of repeating it per
226
+ * reference. Only gc.c builds one; everyone else just passes the pointer along. */
227
+ struct gc_mark_func_data_struct;
228
+
229
+ struct rb_gc_mark_ctx {
230
+ void *objspace;
231
+ struct gc_mark_func_data_struct **mfdp;
232
+ bool checking_shareable;
233
+ };
234
+
235
+ void rb_gc_mark_and_pin_ctx(const struct rb_gc_mark_ctx *ctx, VALUE obj);
236
+ void rb_gc_mark_movable_ctx(const struct rb_gc_mark_ctx *ctx, VALUE obj);
237
+ void rb_gc_mark_maybe_ctx(const struct rb_gc_mark_ctx *ctx, VALUE obj);
238
+ void rb_gc_mark_and_move_ctx(const struct rb_gc_mark_ctx *ctx, VALUE *ptr);
239
+ void rb_gc_mark_locations_ctx(const struct rb_gc_mark_ctx *ctx, const VALUE *start, const VALUE *end);
240
+ void rb_mark_tbl_no_pin_ctx(const struct rb_gc_mark_ctx *ctx, st_table *tbl);
241
+ void rb_gc_mark_set_no_pin_ctx(const struct rb_gc_mark_ctx *ctx, st_table *tbl);
242
+ VALUE rb_gc_location_ctx(const struct rb_gc_mark_ctx *ctx, VALUE value);
243
+ void rb_gc_update_moved_ctx(const struct rb_gc_mark_ctx *ctx, VALUE *ptr);
244
+
245
+ static inline bool
246
+ rb_gc_checking_shareable_ctx(const struct rb_gc_mark_ctx *ctx)
247
+ {
248
+ return ctx->checking_shareable;
249
+ }
250
+
251
+ void rb_gc_ref_update_table_values_only(st_table *tbl);
252
+
253
+ void rb_gc_initial_stress_set(VALUE flag);
254
+
255
+ void rb_gc_before_fork(void);
256
+ void rb_gc_after_fork(rb_pid_t pid);
257
+
258
+ #define rb_gc_mark_and_move_ptr(ptr) do { \
259
+ VALUE _obj = (VALUE)*(ptr); \
260
+ rb_gc_mark_and_move(&_obj); \
261
+ if (_obj != (VALUE)*(ptr)) *(ptr) = (void *)_obj; \
262
+ } while (0)
263
+
264
+ #define rb_gc_update_moved_ptr(ptr) do { \
265
+ VALUE _obj = (VALUE)*(ptr); \
266
+ rb_gc_update_moved(&_obj); \
267
+ if (_obj != (VALUE)*(ptr)) *(ptr) = (void *)_obj; \
268
+ } while (0)
269
+
270
+ #define rb_gc_mark_and_move_ptr_ctx(ctx, ptr) do { \
271
+ VALUE _obj = (VALUE)*(ptr); \
272
+ rb_gc_mark_and_move_ctx((ctx), &_obj); \
273
+ if (_obj != (VALUE)*(ptr)) *(ptr) = (void *)_obj; \
274
+ } while (0)
275
+
276
+ #define rb_gc_update_moved_ptr_ctx(ctx, ptr) do { \
277
+ VALUE _obj = (VALUE)*(ptr); \
278
+ rb_gc_update_moved_ctx((ctx), &_obj); \
279
+ if (_obj != (VALUE)*(ptr)) *(ptr) = (void *)_obj; \
280
+ } while (0)
281
+
282
+ void rb_objspace_reachable_objects_from_local(VALUE obj, void (func)(VALUE, void *), void *data);
283
+
284
+ #if USE_MODULAR_GC
285
+ RUBY_SYMBOL_EXPORT_BEGIN
286
+ #endif
287
+ /* Called only by the default GC's verifier, which lives in the GC's shared object in a
288
+ * modular build, so it needs exporting only there. */
289
+ void rb_objspace_reachable_objects_from_unlocked(VALUE obj, void (func)(VALUE, void *), void *data);
290
+ #if USE_MODULAR_GC
291
+ RUBY_SYMBOL_EXPORT_END
292
+ #endif
293
+
294
+ RUBY_SYMBOL_EXPORT_BEGIN
295
+ /* exports for objspace module */
296
+ void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
297
+ void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data);
298
+ int rb_objspace_internal_object_p(VALUE obj);
299
+ int rb_objspace_garbage_object_p(VALUE obj);
300
+ int rb_objspace_foreign_object_p(VALUE obj);
301
+ int rb_objspace_live_object_p(VALUE obj);
302
+ void rb_gc_declare_weak_references(VALUE obj);
303
+ bool rb_gc_handle_weak_references_alive_p(VALUE obj);
304
+
305
+ void rb_objspace_each_objects(
306
+ int (*callback)(void *start, void *end, size_t stride, void *data),
307
+ void *data);
308
+
309
+
310
+ size_t rb_gc_obj_slot_size(VALUE obj);
311
+
312
+ VALUE rb_gc_disable_no_rest(void);
313
+ /* Local GC disable/enable covering only the current Ractor's objspace. Unlike rb_gc_disable*,
314
+ * which became process-wide, this suppresses GC in one's own objspace only. Exported because
315
+ * DURING_GC_COULD_MALLOC_REGION above expands in bundled extensions. */
316
+ VALUE rb_gc_local_enable(void);
317
+ VALUE rb_gc_local_disable_no_rest(void);
318
+
319
+ #define RB_GC_MAX_NAME_LEN 20
320
+
321
+ /* gc.c (export) */
322
+ const char *rb_objspace_data_type_name(VALUE obj);
323
+ VALUE rb_newobj(struct rb_execution_context_struct *, VALUE, VALUE, uint32_t /* shape_id_t */, bool, size_t);
324
+ VALUE rb_newobj_of(VALUE, VALUE, size_t);
325
+ VALUE rb_ec_newobj_of(struct rb_execution_context_struct *, VALUE, VALUE, size_t);
326
+ size_t rb_obj_memsize_of(VALUE);
327
+ struct rb_gc_object_metadata_entry *rb_gc_object_metadata(VALUE obj);
328
+ void rb_gc_mark_values(long n, const VALUE *values);
329
+ void rb_gc_mark_vm_stack_values(long n, const VALUE *values);
330
+ struct rb_vm_struct;
331
+ void rb_gc_mark_registered_addrs(struct rb_ractor_struct *r, bool need_lock);
332
+ void rb_gc_registered_addrs_enroll_without_gc(struct rb_vm_struct *vm, struct rb_ractor_struct *r);
333
+ void rb_gc_registered_addrs_unenroll_without_gc(struct rb_vm_struct *vm, struct rb_ractor_struct *r);
334
+ void rb_gc_update_values(long n, VALUE *values);
335
+ void rb_gc_mark_set_no_pin(st_table *);
336
+ /* Exercised by the bundled -test-/gc/writebarrier extension, so it must be visible
337
+ * outside the ruby binary. */
338
+ void rb_gc_writebarrier_remember(VALUE obj);
339
+ void rb_gc_update_set_refs(st_table *);
340
+
341
+ #if USE_MODULAR_GC
342
+ const char *rb_gc_active_gc_name(void);
343
+ int rb_gc_modular_gc_loaded_p(void);
344
+ #endif
345
+
346
+ RUBY_SYMBOL_EXPORT_END
347
+
348
+ static inline VALUE
349
+ rb_obj_atomic_write(
350
+ VALUE a, VALUE *slot, VALUE b,
351
+ RBIMPL_ATTR_MAYBE_UNUSED()
352
+ const char *filename,
353
+ RBIMPL_ATTR_MAYBE_UNUSED()
354
+ int line)
355
+ {
356
+ #ifdef RGENGC_LOGGING_WRITE
357
+ RGENGC_LOGGING_WRITE(a, slot, b, filename, line);
358
+ #endif
359
+
360
+ RUBY_ATOMIC_VALUE_SET(*slot, b);
361
+
362
+ rb_obj_written(a, RUBY_Qundef /* ignore `oldv' now */, b, filename, line);
363
+ return a;
364
+ }
365
+ #define RB_OBJ_ATOMIC_WRITE(old, slot, young) \
366
+ RBIMPL_CAST(rb_obj_atomic_write((VALUE)(old), (VALUE *)(slot), (VALUE)(young), __FILE__, __LINE__))
367
+
368
+ int rb_ec_stack_check(struct rb_execution_context_struct *ec);
369
+ void rb_gc_obj_became_shareable(VALUE obj);
370
+ bool rb_gc_multi_objspace_p(void);
371
+ bool rb_gc_obj_foreign_p(VALUE obj);
372
+ void *rb_gc_objspace_alloc(void);
373
+ void rb_gc_objspace_retire_gc(void);
374
+ /* Build an object, or suppress GC, in a named objspace rather than the current
375
+ * Ractor's. Only create_ractor_alloc_thread() needs these. */
376
+ VALUE rb_data_typed_object_wrap_in_objspace(void *objspace, VALUE klass, void *datap, const rb_data_type_t *type);
377
+ VALUE rb_data_typed_object_zalloc_in_objspace(void *objspace, VALUE klass, size_t size, const rb_data_type_t *type);
378
+ VALUE rb_gc_objspace_disable_no_rest(void *objspace);
379
+ VALUE rb_gc_objspace_enable(void *objspace);
380
+
381
+ void rb_gc_objspace_retire(void **objspace_slot);
382
+ void rb_gc_objspace_postmortem_self(void);
383
+ void rb_gc_objspace_absorb_into_current(void **objspace_slot);
384
+ void rb_gc_objspace_absorb_all_zombies(void);
385
+ void rb_gc_objspace_disown(void *objspace);
386
+ void rb_gc_zombie_objspaces_atfork(void);
387
+ void rb_gc_disable_holders_atfork(void);
388
+ void rb_gc_atfork_global_locks(void);
389
+ void rb_gc_stash_cleanup_objspace(void);
390
+ void rb_gc_rest(void);
391
+ bool rb_gc_during_global_gc_p(void);
392
+ bool rb_gc_single_objspace_p(void);
393
+ const char *rb_obj_info(VALUE obj);
394
+ void ruby_annotate_mmap(const void *addr, unsigned long size, const char *name);
395
+
396
+ # define SIZED_REALLOC_N(v, T, m, n) \
397
+ ((v) = (T *)ruby_xrealloc2_sized((void *)(v), (m), sizeof(T), (n)))
398
+
399
+ # define SIZED_FREE(v) ruby_xfree_sized((void *)(v), sizeof(*(v)))
400
+ # define SIZED_FREE_N(v, n) ruby_xfree_sized((void *)(v), sizeof(*(v)) * (n))
401
+
402
+ static inline void *
403
+ ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count)
404
+ {
405
+ return ruby_xrealloc2_sized(ptr, new_count, element_size, old_count);
406
+ }
407
+
408
+ void rb_gc_verify_shareable(VALUE);
409
+ bool rb_gc_checking_shareable(void);
410
+
411
+ #endif /* INTERNAL_GC_H */