datadog-ruby_core_source 3.4.2 → 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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/id.h +10 -5
  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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/basic_operators.h +1 -0
  6. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/bignum.h +22 -10
  7. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/bits.h +14 -17
  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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/cont.h +0 -1
  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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/eval.h +10 -0
  16. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/gc.h +32 -5
  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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/numeric.h +49 -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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/thread.h +15 -11
  33. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/time.h +2 -5
  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-3.5.0-preview1 → ruby-4.0.0-p0}/internal/vm.h +5 -4
  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-3.5.0-preview1 → ruby-4.0.0-p0}/iseq.h +10 -2
  38. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/method.h +21 -3
  39. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/ast.h +360 -70
  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-3.5.0-preview1 → ruby-4.0.0-p0}/prism/options.h +49 -3
  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-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prism.h +40 -15
  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-3.5.0-preview1 → ruby-4.0.0-p0}/rubyparser.h +15 -2
  55. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/shape.h +464 -0
  56. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/thread_pthread.h +13 -3
  57. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_core.h +228 -57
  58. data/lib/datadog/ruby_core_source/version.rb +1 -1
  59. metadata +108 -106
  60. data/CHANGELOG.datadog.md +0 -19
  61. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/class.h +0 -283
  62. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ruby_atomic.h +0 -23
  63. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/shape.h +0 -234
  64. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  65. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/check_type/check_type.h +0 -0
  66. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/container_of/container_of.h +0 -0
  67. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/list/list.h +0 -0
  68. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/str/str.h +0 -0
  69. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compar.h +0 -0
  70. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compile.h +0 -0
  71. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compilers.h +0 -0
  72. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/complex.h +0 -0
  73. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/dir.h +0 -0
  74. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enc.h +0 -0
  75. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enum.h +0 -0
  76. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enumerator.h +0 -0
  77. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/file.h +0 -0
  78. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/fixnum.h +0 -0
  79. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/loadpath.h +0 -0
  80. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/math.h +0 -0
  81. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/missing.h +0 -0
  82. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/parse.h +0 -0
  83. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/proc.h +0 -0
  84. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/process.h +0 -0
  85. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ractor.h +0 -0
  86. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/random.h +0 -0
  87. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/range.h +0 -0
  88. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/rational.h +0 -0
  89. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ruby_parser.h +0 -0
  90. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/serial.h +0 -0
  91. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/static_assert.h +0 -0
  92. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/transcode.h +0 -0
  93. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/util.h +0 -0
  94. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/warnings.h +0 -0
  95. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/node.h +0 -0
  96. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_st.h +0 -0
  97. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_value.h +0 -0
  98. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/defines.h +0 -0
  99. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/encoding.h +0 -0
  100. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/node.h +0 -0
  101. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/pack.h +0 -0
  102. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prettyprint.h +0 -0
  103. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/static_literals.h +0 -0
  104. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_char.h +0 -0
  105. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_constant_pool.h +0 -0
  106. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_memchr.h +0 -0
  107. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_newline_list.h +0 -0
  108. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strncasecmp.h +0 -0
  109. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strpbrk.h +0 -0
  110. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ruby_assert.h +0 -0
  111. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/thread_none.h +0 -0
  112. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_debug.h +4 -4
  113. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_opts.h +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7f84bf2a7b8b11733863cf8534a226b3953725addf23803e802926e3b1a364a
4
- data.tar.gz: 7f5ebbf836ac58cf866d44b406198460125e8bd636c26c42ea8a9cf818a26b41
3
+ metadata.gz: f1d89e58df1d0a5264e3e88f624b7834cba980d62d2f7adf78015a0b73fe439c
4
+ data.tar.gz: 5c9a24d20414775c879b62d03e37b0aa4b5a7d93ad943894c9d8f3b49472b80e
5
5
  SHA512:
6
- metadata.gz: 3aee7d5beea4e580d170f5c9b15edd4942c69c65465efa58263ebd1939fa99aaff5b0916664c51624afce96ae0119fb45c396fe355e5cb07780e0cca1eb21145
7
- data.tar.gz: f71cd6c5b7d27c19699448fbe79d0aad0adf623df0977207a445d423015d852f537eb7f3baaf39fc42dada1011aa7f0676c90fecfb7470e9d4895f4b88a498a0
6
+ metadata.gz: ec54a6bf9b7d188300dd61cdf0c80b6390bbdc7a8550a189725ffebb0426aad3860d8c9d8431449b25411ea5cbc307ef6c005d1c0c8c0165f6eccef82d6dd1db
7
+ data.tar.gz: ead80b734e3eb351fbe1cd5e74b68e0034368fe2a2f1ecdee0817a38b8fef2d10de45e185465f8e283a40ee0d130c1dac66897a701d67c505021ff8528072091
@@ -1,4 +1,4 @@
1
- /* DO NOT EDIT THIS FILE DIRECTLY */
1
+ /* DO NOT EDIT THIS FILE DIRECTLY: source is at template/id.h.tmpl */
2
2
  /**********************************************************************
3
3
 
4
4
  id.h -
@@ -14,15 +14,14 @@
14
14
  #define RUBY_ID_H
15
15
 
16
16
  enum ruby_id_types {
17
- RUBY_ID_STATIC_SYM = 0x01,
18
17
  RUBY_ID_LOCAL = 0x00,
18
+ RUBY_ID_STATIC_SYM = 0x01,
19
19
  RUBY_ID_INSTANCE = (0x01<<1),
20
20
  RUBY_ID_GLOBAL = (0x03<<1),
21
21
  RUBY_ID_ATTRSET = (0x04<<1),
22
22
  RUBY_ID_CONST = (0x05<<1),
23
23
  RUBY_ID_CLASS = (0x06<<1),
24
- RUBY_ID_JUNK = (0x07<<1),
25
- RUBY_ID_INTERNAL = RUBY_ID_JUNK,
24
+ RUBY_ID_INTERNAL = (0x07<<1),
26
25
  RUBY_ID_SCOPE_SHIFT = 4,
27
26
  RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1)
28
27
  };
@@ -36,7 +35,6 @@ enum ruby_id_types {
36
35
  #define ID_ATTRSET RUBY_ID_ATTRSET
37
36
  #define ID_CONST RUBY_ID_CONST
38
37
  #define ID_CLASS RUBY_ID_CLASS
39
- #define ID_JUNK RUBY_ID_JUNK
40
38
  #define ID_INTERNAL RUBY_ID_INTERNAL
41
39
 
42
40
  #define symIFUNC ID2SYM(idIFUNC)
@@ -111,6 +109,7 @@ enum ruby_method_ids {
111
109
  tPRESERVED_ID_BEGIN = 150,
112
110
  idNilP,
113
111
  idIncludeP,
112
+ idItImplicit,
114
113
  idNULL,
115
114
  idEmptyP,
116
115
  idEqlP,
@@ -194,6 +193,8 @@ enum ruby_method_ids {
194
193
  tPath,
195
194
  tPack,
196
195
  tBuffer,
196
+ tAborted,
197
+ tExited,
197
198
  tUScore,
198
199
  tNUMPARAM_1,
199
200
  tNUMPARAM_2,
@@ -204,6 +205,7 @@ enum ruby_method_ids {
204
205
  tNUMPARAM_7,
205
206
  tNUMPARAM_8,
206
207
  tNUMPARAM_9,
208
+ tIt,
207
209
  tDefault,
208
210
  tTOKEN_LOCAL_END,
209
211
  /* LOCAL tokens }}} */
@@ -302,6 +304,8 @@ enum ruby_method_ids {
302
304
  DEFINE_LOCALID_FROM_TOKEN(Path),
303
305
  DEFINE_LOCALID_FROM_TOKEN(Pack),
304
306
  DEFINE_LOCALID_FROM_TOKEN(Buffer),
307
+ DEFINE_LOCALID_FROM_TOKEN(Aborted),
308
+ DEFINE_LOCALID_FROM_TOKEN(Exited),
305
309
  DEFINE_LOCALID_FROM_TOKEN(UScore),
306
310
  DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_1),
307
311
  DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_2),
@@ -312,6 +316,7 @@ enum ruby_method_ids {
312
316
  DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_7),
313
317
  DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_8),
314
318
  DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_9),
319
+ DEFINE_LOCALID_FROM_TOKEN(It),
315
320
  DEFINE_LOCALID_FROM_TOKEN(Default),
316
321
  #undef DEFINE_LOCALID_FROM_TOKEN
317
322
  /* LOCAL IDs }}} */
@@ -16,7 +16,10 @@ enum rb_id_table_iterator_result {
16
16
  };
17
17
 
18
18
  struct rb_id_table *rb_id_table_create(size_t size);
19
+ struct rb_id_table *rb_id_table_init(struct rb_id_table *tbl, size_t capa);
20
+
19
21
  void rb_id_table_free(struct rb_id_table *tbl);
22
+ void rb_id_table_free_items(struct rb_id_table *tbl);
20
23
  void rb_id_table_clear(struct rb_id_table *tbl);
21
24
 
22
25
  size_t rb_id_table_memsize(const struct rb_id_table *tbl);
@@ -32,6 +35,18 @@ void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *fu
32
35
  void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data);
33
36
  void rb_id_table_foreach_values_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, rb_id_table_update_value_callback_func_t *replace, void *data);
34
37
 
38
+ VALUE rb_managed_id_table_create(const rb_data_type_t *type, size_t capa);
39
+ VALUE rb_managed_id_table_new(size_t capa);
40
+ VALUE rb_managed_id_table_dup(VALUE table);
41
+ int rb_managed_id_table_insert(VALUE table, ID id, VALUE val);
42
+ int rb_managed_id_table_lookup(VALUE table, ID id, VALUE *valp);
43
+ size_t rb_managed_id_table_size(VALUE table);
44
+ void rb_managed_id_table_foreach(VALUE table, rb_id_table_foreach_func_t *func, void *data);
45
+ void rb_managed_id_table_foreach_values(VALUE table, rb_id_table_foreach_values_func_t *func, void *data);
46
+ int rb_managed_id_table_delete(VALUE table, ID id);
47
+
48
+ extern const rb_data_type_t rb_managed_id_table_type;
49
+
35
50
  RUBY_SYMBOL_EXPORT_BEGIN
36
51
  size_t rb_id_table_size(const struct rb_id_table *tbl);
37
52
  RUBY_SYMBOL_EXPORT_END
@@ -140,6 +140,8 @@ RARRAY_AREF(VALUE ary, long i)
140
140
  VALUE val;
141
141
  RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
142
142
 
143
+ RUBY_ASSERT(i < RARRAY_LEN(ary));
144
+
143
145
  RBIMPL_WARNING_PUSH();
144
146
  #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ == 13
145
147
  RBIMPL_WARNING_IGNORED(-Warray-bounds);
@@ -24,6 +24,7 @@ enum ruby_basic_operators {
24
24
  BOP_SUCC,
25
25
  BOP_GT,
26
26
  BOP_GE,
27
+ BOP_GTGT,
27
28
  BOP_NOT,
28
29
  BOP_NEQ,
29
30
  BOP_MATCH,
@@ -9,6 +9,7 @@
9
9
  * @brief Internal header for Bignums.
10
10
  */
11
11
  #include "ruby/internal/config.h" /* for HAVE_LIBGMP */
12
+ #include "internal/compilers.h" /* for FLEX_ARY_LEN */
12
13
  #include <stddef.h> /* for size_t */
13
14
 
14
15
  #ifdef HAVE_SYS_TYPES_H
@@ -76,18 +77,17 @@
76
77
  #define RBIGNUM(obj) ((struct RBignum *)(obj))
77
78
  #define BIGNUM_SIGN_BIT FL_USER1
78
79
  #define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2)
79
- #define BIGNUM_EMBED_LEN_NUMBITS 3
80
+
81
+ /* This is likely more bits than we need today and will also need adjustment if
82
+ * we change GC slot sizes.
83
+ */
84
+ #define BIGNUM_EMBED_LEN_NUMBITS 9
80
85
  #define BIGNUM_EMBED_LEN_MASK \
81
- (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT)
86
+ (RUBY_FL_USER11 | RUBY_FL_USER10 | RUBY_FL_USER9 | RUBY_FL_USER8 | RUBY_FL_USER7 | \
87
+ RUBY_FL_USER6 | RUBY_FL_USER5 | RUBY_FL_USER4 | RUBY_FL_USER3)
82
88
  #define BIGNUM_EMBED_LEN_SHIFT \
83
89
  (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */
84
- #ifndef BIGNUM_EMBED_LEN_MAX
85
- # if (SIZEOF_VALUE*RBIMPL_RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1
86
- # define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*RBIMPL_RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT)
87
- # else
88
- # define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1)
89
- # endif
90
- #endif
90
+ #define BIGNUM_EMBED_LEN_MAX (BIGNUM_EMBED_LEN_MASK >> BIGNUM_EMBED_LEN_SHIFT)
91
91
 
92
92
  enum rb_int_parse_flags {
93
93
  RB_INT_PARSE_SIGN = 0x01,
@@ -104,7 +104,12 @@ struct RBignum {
104
104
  size_t len;
105
105
  BDIGIT *digits;
106
106
  } heap;
107
- BDIGIT ary[BIGNUM_EMBED_LEN_MAX];
107
+ /* This is a length 1 array because:
108
+ * 1. GCC has a bug that does not optimize C flexible array members
109
+ * (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102452)
110
+ * 2. Zero length arrays are not supported by all compilers
111
+ */
112
+ BDIGIT ary[1];
108
113
  } as;
109
114
  };
110
115
 
@@ -121,6 +126,7 @@ VALUE rb_integer_float_eq(VALUE x, VALUE y);
121
126
  VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception);
122
127
  VALUE rb_big_comp(VALUE x);
123
128
  VALUE rb_big_aref(VALUE x, VALUE y);
129
+ VALUE rb_big_aref2(VALUE num, VALUE beg, VALUE len);
124
130
  VALUE rb_big_abs(VALUE x);
125
131
  VALUE rb_big_size_m(VALUE big);
126
132
  VALUE rb_big_bit_length(VALUE big);
@@ -163,7 +169,13 @@ VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck);
163
169
  VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags);
164
170
  RUBY_SYMBOL_EXPORT_END
165
171
 
172
+ #if HAVE_LONG_LONG
173
+ VALUE rb_ull2big(unsigned LONG_LONG n);
174
+ VALUE rb_ll2big(LONG_LONG n);
175
+ #endif
176
+
166
177
  #if defined(HAVE_INT128_T)
178
+ VALUE rb_uint128t2big(uint128_t n);
167
179
  VALUE rb_int128t2big(int128_t n);
168
180
  #endif
169
181
 
@@ -30,13 +30,13 @@
30
30
  #include <stdint.h> /* for uintptr_t */
31
31
  #include "internal/compilers.h" /* for MSC_VERSION_SINCE */
32
32
 
33
- #if MSC_VERSION_SINCE(1310)
33
+ #ifdef _MSC_VER
34
34
  # include <stdlib.h> /* for _byteswap_uint64 */
35
35
  #endif
36
36
 
37
37
  #if defined(HAVE_X86INTRIN_H)
38
38
  # include <x86intrin.h> /* for _lzcnt_u64 */
39
- #elif MSC_VERSION_SINCE(1310)
39
+ #elif defined(_MSC_VER)
40
40
  # include <intrin.h> /* for the following intrinsics */
41
41
  #endif
42
42
 
@@ -50,16 +50,13 @@
50
50
  # pragma intrinsic(__lzcnt64)
51
51
  #endif
52
52
 
53
- #if MSC_VERSION_SINCE(1310)
53
+ #if defined(_MSC_VER)
54
54
  # pragma intrinsic(_rotl)
55
55
  # pragma intrinsic(_rotr)
56
56
  # ifdef _WIN64
57
57
  # pragma intrinsic(_rotl64)
58
58
  # pragma intrinsic(_rotr64)
59
59
  # endif
60
- #endif
61
-
62
- #if MSC_VERSION_SINCE(1400)
63
60
  # pragma intrinsic(_BitScanForward)
64
61
  # pragma intrinsic(_BitScanReverse)
65
62
  # ifdef _WIN64
@@ -266,7 +263,7 @@ ruby_swap16(uint16_t x)
266
263
  #if __has_builtin(__builtin_bswap16)
267
264
  return __builtin_bswap16(x);
268
265
 
269
- #elif MSC_VERSION_SINCE(1310)
266
+ #elif defined(_MSC_VER)
270
267
  return _byteswap_ushort(x);
271
268
 
272
269
  #else
@@ -281,7 +278,7 @@ ruby_swap32(uint32_t x)
281
278
  #if __has_builtin(__builtin_bswap32)
282
279
  return __builtin_bswap32(x);
283
280
 
284
- #elif MSC_VERSION_SINCE(1310)
281
+ #elif defined(_MSC_VER)
285
282
  return _byteswap_ulong(x);
286
283
 
287
284
  #else
@@ -298,7 +295,7 @@ ruby_swap64(uint64_t x)
298
295
  #if __has_builtin(__builtin_bswap64)
299
296
  return __builtin_bswap64(x);
300
297
 
301
- #elif MSC_VERSION_SINCE(1310)
298
+ #elif defined(_MSC_VER)
302
299
  return _byteswap_uint64(x);
303
300
 
304
301
  #else
@@ -323,7 +320,7 @@ nlz_int32(uint32_t x)
323
320
  #elif defined(__x86_64__) && defined(__LZCNT__)
324
321
  return (unsigned int)_lzcnt_u32(x);
325
322
 
326
- #elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */
323
+ #elif defined(_MSC_VER) /* &&! defined(__AVX2__) */
327
324
  unsigned long r;
328
325
  return _BitScanReverse(&r, x) ? (31 - (int)r) : 32;
329
326
 
@@ -352,7 +349,7 @@ nlz_int64(uint64_t x)
352
349
  #elif defined(__x86_64__) && defined(__LZCNT__)
353
350
  return (unsigned int)_lzcnt_u64(x);
354
351
 
355
- #elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */
352
+ #elif defined(_WIN64) && defined(_MSC_VER) /* &&! defined(__AVX2__) */
356
353
  unsigned long r;
357
354
  return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64;
358
355
 
@@ -538,7 +535,7 @@ ntz_int32(uint32_t x)
538
535
  #if defined(__x86_64__) && defined(__BMI__)
539
536
  return (unsigned)_tzcnt_u32(x);
540
537
 
541
- #elif MSC_VERSION_SINCE(1400)
538
+ #elif defined(_MSC_VER)
542
539
  /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using
543
540
  * assembly? Because issuing LZCNT seems possible (see nlz.h). */
544
541
  unsigned long r;
@@ -560,7 +557,7 @@ ntz_int64(uint64_t x)
560
557
  #if defined(__x86_64__) && defined(__BMI__)
561
558
  return (unsigned)_tzcnt_u64(x);
562
559
 
563
- #elif defined(_WIN64) && MSC_VERSION_SINCE(1400)
560
+ #elif defined(_WIN64) && defined(_MSC_VER)
564
561
  unsigned long r;
565
562
  return _BitScanForward64(&r, x) ? (int)r : 64;
566
563
 
@@ -608,10 +605,10 @@ RUBY_BIT_ROTL(VALUE v, int n)
608
605
  #elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64)
609
606
  return __builtin_rotateleft64(v, n);
610
607
 
611
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32)
608
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 32)
612
609
  return _rotl(v, n);
613
610
 
614
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64)
611
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 64)
615
612
  return _rotl64(v, n);
616
613
 
617
614
  #elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG)
@@ -632,10 +629,10 @@ RUBY_BIT_ROTR(VALUE v, int n)
632
629
  #elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64)
633
630
  return __builtin_rotateright64(v, n);
634
631
 
635
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32)
632
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 32)
636
633
  return _rotr(v, n);
637
634
 
638
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64)
635
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 64)
639
636
  return _rotr64(v, n);
640
637
 
641
638
  #elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG)
@@ -0,0 +1,83 @@
1
+ #ifndef INTERNAL_BOX_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_BOX_H
3
+
4
+ #include "ruby/ruby.h" /* for VALUE */
5
+
6
+ /**
7
+ * @author Ruby developers <ruby-core@ruby-lang.org>
8
+ * @copyright This file is a part of the programming language Ruby.
9
+ * Permission is hereby granted, to either redistribute and/or
10
+ * modify this file, provided that the conditions mentioned in the
11
+ * file COPYING are met. Consult the file for details.
12
+ * @brief Internal header for Ruby Box.
13
+ */
14
+ struct rb_box_struct {
15
+ /*
16
+ * To retrieve Ruby::Box object that provides #require and so on.
17
+ * That is used from load.c, etc., that uses rb_box_t internally.
18
+ */
19
+ VALUE box_object;
20
+ long box_id; // box_id to generate ext filenames
21
+
22
+ VALUE top_self;
23
+
24
+ VALUE load_path;
25
+ VALUE load_path_snapshot;
26
+ VALUE load_path_check_cache;
27
+ VALUE expanded_load_path;
28
+ VALUE loaded_features;
29
+ VALUE loaded_features_snapshot;
30
+ VALUE loaded_features_realpaths;
31
+ VALUE loaded_features_realpath_map;
32
+ struct st_table *loaded_features_index;
33
+ struct st_table *loading_table;
34
+ VALUE ruby_dln_libmap;
35
+
36
+ VALUE gvar_tbl;
37
+ struct st_table *classext_cow_classes;
38
+
39
+ bool is_user;
40
+ bool is_optional;
41
+ };
42
+ typedef struct rb_box_struct rb_box_t;
43
+
44
+ #define BOX_OBJ_P(obj) (rb_obj_class(obj) == rb_cBox)
45
+
46
+ #define BOX_ROOT_P(box) (box && !box->is_user)
47
+ #define BOX_USER_P(box) (box && box->is_user)
48
+ #define BOX_OPTIONAL_P(box) (box && box->is_optional)
49
+ #define BOX_MAIN_P(box) (box && box->is_user && !box->is_optional)
50
+
51
+ #define BOX_METHOD_DEFINITION(mdef) (mdef ? mdef->ns : NULL)
52
+ #define BOX_METHOD_ENTRY(me) (me ? BOX_METHOD_DEFINITION(me->def) : NULL)
53
+ #define BOX_CC(cc) (cc ? BOX_METHOD_ENTRY(cc->cme_) : NULL)
54
+ #define BOX_CC_ENTRIES(ccs) (ccs ? BOX_METHOD_ENTRY(ccs->cme) : NULL)
55
+
56
+ RUBY_EXTERN bool ruby_box_enabled;
57
+ RUBY_EXTERN bool ruby_box_init_done;
58
+ RUBY_EXTERN bool ruby_box_crashed;
59
+
60
+ static inline bool
61
+ rb_box_available(void)
62
+ {
63
+ return ruby_box_enabled;
64
+ }
65
+
66
+ const rb_box_t * rb_root_box(void);
67
+ const rb_box_t * rb_main_box(void);
68
+ const rb_box_t * rb_current_box(void);
69
+ const rb_box_t * rb_loading_box(void);
70
+ const rb_box_t * rb_current_box_in_crash_report(void);
71
+
72
+ void rb_box_entry_mark(void *);
73
+ void rb_box_gc_update_references(void *ptr);
74
+
75
+ rb_box_t * rb_get_box_t(VALUE ns);
76
+ VALUE rb_get_box_object(rb_box_t *ns);
77
+
78
+ VALUE rb_box_local_extension(VALUE box, VALUE fname, VALUE path, VALUE *cleanup);
79
+ void rb_box_cleanup_local_extension(VALUE cleanup);
80
+
81
+ void rb_initialize_main_box(void);
82
+ void rb_box_init_done(void);
83
+ #endif /* INTERNAL_BOX_H */