datadog-ruby_core_source 3.5.2 → 3.5.4
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.
- checksums.yaml +4 -4
- data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/thread_win32.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/thread_win32.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/thread_win32.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/constant.h +53 -0
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/debug_counter.h +423 -0
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_sync.h +137 -0
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/constant.h +53 -0
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/debug_counter.h +423 -0
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_sync.h +137 -0
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/constant.h +53 -0
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/debug_counter.h +423 -0
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/vm_sync.h +137 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/constant.h +53 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/debug_counter.h +425 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_sync.h +160 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ccan/list/list.h +791 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ccan/str/str.h +17 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/constant.h +53 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/debug_counter.h +426 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/id.h +357 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/id_table.h +64 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/array.h +155 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/basic_operators.h +66 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/box.h +96 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/class.h +749 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/compilers.h +107 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/gc.h +360 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/imemo.h +323 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/sanitizers.h +346 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/serial.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/set_table.h +70 -0
- data/lib/datadog/ruby_core_source/{ruby-3.3.5-p100/internal/dir.h → ruby-4.0.6-p0/internal/static_assert.h} +8 -8
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/variable.h +76 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/vm.h +138 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal/warnings.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/internal.h +105 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/iseq.h +359 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/method.h +276 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/node.h +122 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/parser_st.h +162 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/parser_value.h +106 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/ast.h +8254 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/defines.h +260 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/diagnostic.h +460 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/encoding.h +283 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/node.h +129 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/options.h +488 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/pack.h +163 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/parser.h +936 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/prettyprint.h +34 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/prism.h +408 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/regexp.h +43 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/static_literals.h +121 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_buffer.h +236 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_char.h +204 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_constant_pool.h +218 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_integer.h +130 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_list.h +103 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_memchr.h +29 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_newline_list.h +113 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_string.h +200 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_strncasecmp.h +32 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/util/pm_strpbrk.h +46 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism/version.h +29 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/prism_compile.h +106 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ractor_core.h +331 -0
- data/lib/datadog/ruby_core_source/{ruby-3.4.0-p0/internal/dir.h → ruby-4.0.6-p0/ruby_assert.h} +6 -8
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/ruby_atomic.h +73 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/rubyparser.h +1393 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/shape.h +464 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/thread_none.h +21 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/thread_pthread.h +185 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/vm_core.h +2408 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/vm_debug.h +124 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/vm_opts.h +67 -0
- data/lib/datadog/ruby_core_source/ruby-4.0.6-p0/vm_sync.h +160 -0
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- metadata +81 -179
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/bignum.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/bits.h +0 -568
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/cmdlineopt.h +0 -65
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/cont.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/dir.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/encoding.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/error.h +0 -216
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/eval.h +0 -32
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/fixnum.h +0 -184
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/hash.h +0 -191
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/inits.h +0 -50
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/io.h +0 -137
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/load.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/missing.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/numeric.h +0 -273
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/object.h +0 -60
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/parse.h +0 -108
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/proc.h +0 -30
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/ractor.h +0 -6
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/re.h +0 -28
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/ruby_parser.h +0 -69
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/sanitizers.h +0 -186
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/signal.h +0 -25
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/string.h +0 -159
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/struct.h +0 -127
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/symbol.h +0 -45
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/thread.h +0 -78
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/time.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/extension.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/bignum.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/bits.h +0 -568
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/cmdlineopt.h +0 -65
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/cont.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/encoding.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/error.h +0 -216
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/eval.h +0 -33
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/fixnum.h +0 -184
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/hash.h +0 -191
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/inits.h +0 -50
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/io.h +0 -137
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/load.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/missing.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/numeric.h +0 -273
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/object.h +0 -62
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/parse.h +0 -108
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/proc.h +0 -30
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/ractor.h +0 -6
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/re.h +0 -28
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/ruby_parser.h +0 -69
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/sanitizers.h +0 -186
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/signal.h +0 -25
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/string.h +0 -160
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/struct.h +0 -127
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/symbol.h +0 -45
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/thread.h +0 -78
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/time.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/extension.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/bignum.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/bits.h +0 -650
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/cmdlineopt.h +0 -65
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/cont.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/encoding.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/error.h +0 -244
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/eval.h +0 -33
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/fixnum.h +0 -185
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/hash.h +0 -192
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/inits.h +0 -47
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/io.h +0 -143
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/load.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/missing.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/numeric.h +0 -274
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/object.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/parse.h +0 -130
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/proc.h +0 -31
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/ractor.h +0 -10
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/re.h +0 -28
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/ruby_parser.h +0 -102
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/signal.h +0 -24
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/st.h +0 -11
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/string.h +0 -198
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/struct.h +0 -127
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/symbol.h +0 -45
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/thread.h +0 -108
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/time.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-3.4.0-p0/prism/extension.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bignum.h +0 -256
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bits.h +0 -647
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/cmdlineopt.h +0 -64
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/concurrent_set.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/cont.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/dir.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/encoding.h +0 -39
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/error.h +0 -251
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/eval.h +0 -43
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/fixnum.h +0 -185
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/hash.h +0 -194
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/inits.h +0 -51
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/io.h +0 -163
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/load.h +0 -20
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/missing.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/numeric.h +0 -323
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/object.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/parse.h +0 -131
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/proc.h +0 -30
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/ractor.h +0 -10
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/re.h +0 -33
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/ruby_parser.h +0 -102
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/signal.h +0 -25
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/st.h +0 -11
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/string.h +0 -203
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/struct.h +0 -160
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/symbol.h +0 -46
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/thread.h +0 -112
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/time.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/extension.h +0 -19
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
#ifndef INTERNAL_IMEMO_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_IMEMO_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 IMEMO: Internal memo object.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h"
|
|
12
|
+
#include <stddef.h> /* for size_t */
|
|
13
|
+
#include "id_table.h"
|
|
14
|
+
#include "internal/array.h" /* for rb_ary_hidden_new_fill */
|
|
15
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
|
16
|
+
#include "ruby/ruby.h" /* for rb_block_call_func_t */
|
|
17
|
+
|
|
18
|
+
#define IMEMO_MASK 0x0f
|
|
19
|
+
|
|
20
|
+
/* FL_USER0 to FL_USER3 is for type */
|
|
21
|
+
#define IMEMO_FL_USHIFT (FL_USHIFT + 4)
|
|
22
|
+
#define IMEMO_FL_USER0 FL_USER4
|
|
23
|
+
#define IMEMO_FL_USER1 FL_USER5
|
|
24
|
+
#define IMEMO_FL_USER2 FL_USER6
|
|
25
|
+
#define IMEMO_FL_USER3 FL_USER7
|
|
26
|
+
#define IMEMO_FL_USER4 FL_USER8
|
|
27
|
+
#define IMEMO_FL_USER5 FL_USER9
|
|
28
|
+
#define IMEMO_FL_USER6 FL_USER10
|
|
29
|
+
|
|
30
|
+
enum imemo_type {
|
|
31
|
+
imemo_env = 0,
|
|
32
|
+
imemo_cref = 1, /*!< class reference */
|
|
33
|
+
imemo_svar = 2, /*!< special variable */
|
|
34
|
+
imemo_throw_data = 3,
|
|
35
|
+
imemo_ifunc = 4, /*!< iterator function */
|
|
36
|
+
imemo_memo = 5,
|
|
37
|
+
imemo_ment = 6,
|
|
38
|
+
imemo_iseq = 7,
|
|
39
|
+
imemo_tmpbuf = 8,
|
|
40
|
+
imemo_cvar_entry = 9,
|
|
41
|
+
imemo_callinfo = 10,
|
|
42
|
+
imemo_callcache = 11,
|
|
43
|
+
imemo_constcache = 12,
|
|
44
|
+
imemo_fields = 13,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/* CREF (Class REFerence) is defined in method.h */
|
|
48
|
+
|
|
49
|
+
/*! SVAR (Special VARiable) */
|
|
50
|
+
struct vm_svar {
|
|
51
|
+
VALUE flags;
|
|
52
|
+
const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */
|
|
53
|
+
const VALUE lastline;
|
|
54
|
+
const VALUE backref;
|
|
55
|
+
const VALUE others;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/*! THROW_DATA */
|
|
59
|
+
struct vm_throw_data {
|
|
60
|
+
VALUE flags;
|
|
61
|
+
VALUE reserved;
|
|
62
|
+
const VALUE throw_obj;
|
|
63
|
+
const struct rb_control_frame_struct *catch_frame;
|
|
64
|
+
int throw_state;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
#define THROW_DATA_CONSUMED IMEMO_FL_USER0
|
|
68
|
+
|
|
69
|
+
/* IFUNC (Internal FUNCtion) */
|
|
70
|
+
|
|
71
|
+
struct vm_ifunc_argc {
|
|
72
|
+
#if SIZEOF_INT * 2 > SIZEOF_VALUE
|
|
73
|
+
signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
|
|
74
|
+
signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
|
|
75
|
+
#else
|
|
76
|
+
int min, max;
|
|
77
|
+
#endif
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/*! IFUNC (Internal FUNCtion)
|
|
81
|
+
*
|
|
82
|
+
* Bookkeeping for converting a C function and some closed-over data into a
|
|
83
|
+
* block passable to methods. Like Ruby Proc, but not directly accessible at
|
|
84
|
+
* Ruby level since this is an imemo. See rb_block_call() and friends.
|
|
85
|
+
*/
|
|
86
|
+
struct vm_ifunc {
|
|
87
|
+
VALUE flags;
|
|
88
|
+
VALUE *svar_lep;
|
|
89
|
+
rb_block_call_func_t func;
|
|
90
|
+
const void *data;
|
|
91
|
+
struct vm_ifunc_argc argc;
|
|
92
|
+
};
|
|
93
|
+
#define IFUNC_YIELD_OPTIMIZABLE IMEMO_FL_USER0
|
|
94
|
+
|
|
95
|
+
struct rb_imemo_tmpbuf_struct {
|
|
96
|
+
VALUE flags;
|
|
97
|
+
VALUE *ptr; /* malloc'ed buffer */
|
|
98
|
+
size_t cnt; /* buffer size in VALUE */
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/*! MEMO
|
|
102
|
+
*
|
|
103
|
+
* @see imemo_type
|
|
104
|
+
* */
|
|
105
|
+
struct MEMO {
|
|
106
|
+
VALUE flags;
|
|
107
|
+
VALUE reserved;
|
|
108
|
+
const VALUE v1;
|
|
109
|
+
const VALUE v2;
|
|
110
|
+
union {
|
|
111
|
+
long cnt;
|
|
112
|
+
long state;
|
|
113
|
+
const VALUE value;
|
|
114
|
+
void (*func)(void);
|
|
115
|
+
} u3;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
#define IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0), sizeof(T), false))
|
|
119
|
+
#define SHAREABLE_IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0), sizeof(T), true))
|
|
120
|
+
|
|
121
|
+
/* ment is in method.h */
|
|
122
|
+
|
|
123
|
+
#define THROW_DATA_P(err) imemo_throw_data_p((VALUE)err)
|
|
124
|
+
#define MEMO_CAST(m) ((struct MEMO *)(m))
|
|
125
|
+
#define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
|
|
126
|
+
#define NEW_MEMO_FOR(type, value) \
|
|
127
|
+
((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))
|
|
128
|
+
#define NEW_PARTIAL_MEMO_FOR(type, value, member) \
|
|
129
|
+
((value) = rb_ary_hidden_new_fill(type_roomof(type, VALUE)), \
|
|
130
|
+
rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \
|
|
131
|
+
MEMO_FOR(type, value))
|
|
132
|
+
|
|
133
|
+
#ifndef RUBY_RUBYPARSER_H
|
|
134
|
+
typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
|
|
135
|
+
#endif
|
|
136
|
+
VALUE rb_imemo_new(enum imemo_type type, VALUE v0, size_t size, bool is_shareable);
|
|
137
|
+
VALUE rb_imemo_tmpbuf_new(void);
|
|
138
|
+
struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
|
|
139
|
+
static inline enum imemo_type imemo_type(VALUE imemo);
|
|
140
|
+
static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);
|
|
141
|
+
static inline bool imemo_throw_data_p(VALUE imemo);
|
|
142
|
+
static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data);
|
|
143
|
+
static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v);
|
|
144
|
+
static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr);
|
|
145
|
+
static inline void MEMO_V1_SET(struct MEMO *m, VALUE v);
|
|
146
|
+
static inline void MEMO_V2_SET(struct MEMO *m, VALUE v);
|
|
147
|
+
|
|
148
|
+
size_t rb_imemo_memsize(VALUE obj);
|
|
149
|
+
void rb_imemo_mark_and_move(VALUE obj, bool reference_updating);
|
|
150
|
+
void rb_imemo_free(VALUE obj);
|
|
151
|
+
|
|
152
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
153
|
+
const char *rb_imemo_name(enum imemo_type type);
|
|
154
|
+
RUBY_SYMBOL_EXPORT_END
|
|
155
|
+
|
|
156
|
+
static inline struct MEMO *
|
|
157
|
+
MEMO_NEW(VALUE a, VALUE b, VALUE c)
|
|
158
|
+
{
|
|
159
|
+
struct MEMO *memo = IMEMO_NEW(struct MEMO, imemo_memo, 0);
|
|
160
|
+
*((VALUE *)&memo->v1) = a;
|
|
161
|
+
*((VALUE *)&memo->v2) = b;
|
|
162
|
+
*((VALUE *)&memo->u3.value) = c;
|
|
163
|
+
|
|
164
|
+
return memo;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static inline enum imemo_type
|
|
168
|
+
imemo_type(VALUE imemo)
|
|
169
|
+
{
|
|
170
|
+
return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static inline int
|
|
174
|
+
imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
|
|
175
|
+
{
|
|
176
|
+
if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) {
|
|
177
|
+
/* fixed at compile time if imemo_type is given. */
|
|
178
|
+
const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK;
|
|
179
|
+
const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO;
|
|
180
|
+
/* fixed at runtime. */
|
|
181
|
+
return expected_type == (RBASIC(imemo)->flags & mask);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
return 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
#define IMEMO_TYPE_P(v, t) imemo_type_p((VALUE)(v), t)
|
|
189
|
+
|
|
190
|
+
static inline bool
|
|
191
|
+
imemo_throw_data_p(VALUE imemo)
|
|
192
|
+
{
|
|
193
|
+
return RB_TYPE_P(imemo, T_IMEMO);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static inline struct vm_ifunc *
|
|
197
|
+
rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data)
|
|
198
|
+
{
|
|
199
|
+
return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static inline void *
|
|
203
|
+
RB_IMEMO_TMPBUF_PTR(VALUE v)
|
|
204
|
+
{
|
|
205
|
+
const struct rb_imemo_tmpbuf_struct *p = (const void *)v;
|
|
206
|
+
return p->ptr;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
static inline void *
|
|
210
|
+
rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
|
|
211
|
+
{
|
|
212
|
+
return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
static inline VALUE
|
|
216
|
+
rb_imemo_tmpbuf_new_from_an_RString(VALUE str)
|
|
217
|
+
{
|
|
218
|
+
const void *src;
|
|
219
|
+
VALUE imemo;
|
|
220
|
+
rb_imemo_tmpbuf_t *tmpbuf;
|
|
221
|
+
void *dst;
|
|
222
|
+
size_t len;
|
|
223
|
+
|
|
224
|
+
StringValue(str);
|
|
225
|
+
/* create tmpbuf to keep the pointer before xmalloc */
|
|
226
|
+
imemo = rb_imemo_tmpbuf_new();
|
|
227
|
+
tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
|
|
228
|
+
len = RSTRING_LEN(str);
|
|
229
|
+
src = RSTRING_PTR(str);
|
|
230
|
+
dst = ruby_xmalloc(len);
|
|
231
|
+
memcpy(dst, src, len);
|
|
232
|
+
tmpbuf->ptr = dst;
|
|
233
|
+
return imemo;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
static inline void
|
|
237
|
+
MEMO_V1_SET(struct MEMO *m, VALUE v)
|
|
238
|
+
{
|
|
239
|
+
RB_OBJ_WRITE(m, &m->v1, v);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
static inline void
|
|
243
|
+
MEMO_V2_SET(struct MEMO *m, VALUE v)
|
|
244
|
+
{
|
|
245
|
+
RB_OBJ_WRITE(m, &m->v2, v);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
struct rb_fields {
|
|
249
|
+
struct RBasic basic;
|
|
250
|
+
union {
|
|
251
|
+
struct {
|
|
252
|
+
VALUE fields[1];
|
|
253
|
+
} embed;
|
|
254
|
+
struct {
|
|
255
|
+
VALUE *ptr;
|
|
256
|
+
} external;
|
|
257
|
+
struct {
|
|
258
|
+
// Note: the st_table could be embedded, but complex T_CLASS should be rare to
|
|
259
|
+
// non-existent, so not really worth the trouble.
|
|
260
|
+
st_table *table;
|
|
261
|
+
} complex;
|
|
262
|
+
} as;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
// IMEMO/fields and T_OBJECT have exactly the same layout.
|
|
266
|
+
// This is useful for JIT and common codepaths.
|
|
267
|
+
#define OBJ_FIELD_HEAP ROBJECT_HEAP
|
|
268
|
+
STATIC_ASSERT(imemo_fields_flags, OBJ_FIELD_HEAP == IMEMO_FL_USER0);
|
|
269
|
+
STATIC_ASSERT(imemo_fields_embed_offset, offsetof(struct RObject, as.ary) == offsetof(struct rb_fields, as.embed.fields));
|
|
270
|
+
STATIC_ASSERT(imemo_fields_embed_offset, offsetof(struct RObject, as.heap.fields) == offsetof(struct rb_fields, as.external.ptr));
|
|
271
|
+
STATIC_ASSERT(imemo_fields_embed_offset, offsetof(struct RObject, as.heap.fields) == offsetof(struct rb_fields, as.complex.table));
|
|
272
|
+
|
|
273
|
+
#define IMEMO_OBJ_FIELDS(fields) ((struct rb_fields *)fields)
|
|
274
|
+
|
|
275
|
+
VALUE rb_imemo_fields_new(VALUE owner, size_t capa, bool shareable);
|
|
276
|
+
VALUE rb_imemo_fields_new_complex(VALUE owner, size_t capa, bool shareable);
|
|
277
|
+
VALUE rb_imemo_fields_new_complex_tbl(VALUE owner, st_table *tbl, bool shareable);
|
|
278
|
+
VALUE rb_imemo_fields_clone(VALUE fields_obj);
|
|
279
|
+
void rb_imemo_fields_clear(VALUE fields_obj);
|
|
280
|
+
|
|
281
|
+
static inline VALUE
|
|
282
|
+
rb_imemo_fields_owner(VALUE fields_obj)
|
|
283
|
+
{
|
|
284
|
+
RUBY_ASSERT(IMEMO_TYPE_P(fields_obj, imemo_fields));
|
|
285
|
+
|
|
286
|
+
return CLASS_OF(fields_obj);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
static inline VALUE *
|
|
290
|
+
rb_imemo_fields_ptr(VALUE fields_obj)
|
|
291
|
+
{
|
|
292
|
+
if (!fields_obj) {
|
|
293
|
+
return NULL;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
RUBY_ASSERT(IMEMO_TYPE_P(fields_obj, imemo_fields) || RB_TYPE_P(fields_obj, T_OBJECT));
|
|
297
|
+
|
|
298
|
+
if (UNLIKELY(FL_TEST_RAW(fields_obj, OBJ_FIELD_HEAP))) {
|
|
299
|
+
return IMEMO_OBJ_FIELDS(fields_obj)->as.external.ptr;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
return IMEMO_OBJ_FIELDS(fields_obj)->as.embed.fields;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
static inline st_table *
|
|
307
|
+
rb_imemo_fields_complex_tbl(VALUE fields_obj)
|
|
308
|
+
{
|
|
309
|
+
if (!fields_obj) {
|
|
310
|
+
return NULL;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
RUBY_ASSERT(IMEMO_TYPE_P(fields_obj, imemo_fields) || RB_TYPE_P(fields_obj, T_OBJECT));
|
|
314
|
+
RUBY_ASSERT(FL_TEST_RAW(fields_obj, OBJ_FIELD_HEAP));
|
|
315
|
+
|
|
316
|
+
// Some codepaths unconditionally access the fields_ptr, and assume it can be used as st_table if the
|
|
317
|
+
// shape is too_complex.
|
|
318
|
+
RUBY_ASSERT((st_table *)rb_imemo_fields_ptr(fields_obj) == IMEMO_OBJ_FIELDS(fields_obj)->as.complex.table);
|
|
319
|
+
|
|
320
|
+
return IMEMO_OBJ_FIELDS(fields_obj)->as.complex.table;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
#endif /* INTERNAL_IMEMO_H */
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
#ifndef INTERNAL_SANITIZERS_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_SANITIZERS_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 ASAN / MSAN / etc.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h"
|
|
12
|
+
#include "internal/compilers.h" /* for __has_feature */
|
|
13
|
+
|
|
14
|
+
#ifdef HAVE_VALGRIND_MEMCHECK_H
|
|
15
|
+
# include <valgrind/memcheck.h>
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#ifdef HAVE_SANITIZER_ASAN_INTERFACE_H
|
|
19
|
+
# if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
|
|
20
|
+
# define RUBY_ASAN_ENABLED
|
|
21
|
+
# include <sanitizer/asan_interface.h>
|
|
22
|
+
# endif
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
#ifdef HAVE_SANITIZER_MSAN_INTERFACE_H
|
|
26
|
+
# if __has_feature(memory_sanitizer)
|
|
27
|
+
# define RUBY_MSAN_ENABLED
|
|
28
|
+
# include <sanitizer/msan_interface.h>
|
|
29
|
+
# endif
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#ifdef HAVE_SANITIZER_TSAN_INTERFACE_H
|
|
33
|
+
# if __has_feature(thread_sanitizer) || defined(__SANITIZE_THREAD__)
|
|
34
|
+
# define RUBY_TSAN_ENABLED
|
|
35
|
+
# include <sanitizer/tsan_interface.h>
|
|
36
|
+
# endif
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
|
40
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
41
|
+
|
|
42
|
+
#if 0
|
|
43
|
+
#elif defined(RUBY_ASAN_ENABLED) && defined(RUBY_MSAN_ENABLED)
|
|
44
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
45
|
+
__attribute__((__no_sanitize__("memory, address"), __noinline__)) x
|
|
46
|
+
#elif defined(RUBY_ASAN_ENABLED)
|
|
47
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
48
|
+
__attribute__((__no_sanitize__("address"), __noinline__)) x
|
|
49
|
+
#elif defined(RUBY_MSAN_ENABLED)
|
|
50
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
51
|
+
__attribute__((__no_sanitize__("memory"), __noinline__)) x
|
|
52
|
+
#elif defined(RUBY_TSAN_ENABLED)
|
|
53
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
54
|
+
__attribute__((__no_sanitize__("thread"), __noinline__)) x
|
|
55
|
+
#elif defined(NO_SANITIZE_ADDRESS)
|
|
56
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
57
|
+
NO_SANITIZE_ADDRESS(NOINLINE(x))
|
|
58
|
+
#elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
|
|
59
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
60
|
+
NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x))
|
|
61
|
+
#else
|
|
62
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
#if defined(NO_SANITIZE) && RBIMPL_COMPILER_IS(GCC)
|
|
66
|
+
/* GCC warns about unknown sanitizer, which is annoying. */
|
|
67
|
+
# include "internal/warnings.h"
|
|
68
|
+
# undef NO_SANITIZE
|
|
69
|
+
# define NO_SANITIZE(x, y) \
|
|
70
|
+
COMPILER_WARNING_PUSH \
|
|
71
|
+
COMPILER_WARNING_IGNORED(-Wattributes) \
|
|
72
|
+
__attribute__((__no_sanitize__(x))) y; \
|
|
73
|
+
COMPILER_WARNING_POP \
|
|
74
|
+
y
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
#ifndef NO_SANITIZE
|
|
78
|
+
# define NO_SANITIZE(x, y) y
|
|
79
|
+
#endif
|
|
80
|
+
|
|
81
|
+
#ifndef RUBY_ASAN_ENABLED
|
|
82
|
+
# define __asan_poison_memory_region(x, y)
|
|
83
|
+
# define __asan_unpoison_memory_region(x, y)
|
|
84
|
+
# define __asan_region_is_poisoned(x, y) 0
|
|
85
|
+
# define __asan_get_current_fake_stack() NULL
|
|
86
|
+
# define __asan_addr_is_in_fake_stack(fake_stack, slot, start, end) NULL
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
#ifndef RUBY_MSAN_ENABLED
|
|
90
|
+
# define __msan_allocated_memory(x, y) ((void)(x), (void)(y))
|
|
91
|
+
# define __msan_poison(x, y) ((void)(x), (void)(y))
|
|
92
|
+
# define __msan_unpoison(x, y) ((void)(x), (void)(y))
|
|
93
|
+
# define __msan_unpoison_string(x) ((void)(x))
|
|
94
|
+
#endif
|
|
95
|
+
|
|
96
|
+
#ifdef VALGRIND_MAKE_READABLE
|
|
97
|
+
# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
|
|
98
|
+
#endif
|
|
99
|
+
|
|
100
|
+
#ifdef VALGRIND_MAKE_WRITABLE
|
|
101
|
+
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
|
|
102
|
+
#endif
|
|
103
|
+
|
|
104
|
+
#ifndef VALGRIND_MAKE_MEM_DEFINED
|
|
105
|
+
# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
#ifndef VALGRIND_MAKE_MEM_UNDEFINED
|
|
109
|
+
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
|
|
110
|
+
#endif
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* This function asserts that a (continuous) memory region from ptr to size
|
|
114
|
+
* being "poisoned". Both read / write access to such memory region are
|
|
115
|
+
* prohibited until properly unpoisoned. The region must be previously
|
|
116
|
+
* allocated (do not pass a freed pointer here), but not necessarily be an
|
|
117
|
+
* entire object that the malloc returns. You can punch hole a part of a
|
|
118
|
+
* gigantic heap arena. This is handy when you do not free an allocated memory
|
|
119
|
+
* region to reuse later: poison when you keep it unused, and unpoison when you
|
|
120
|
+
* reuse.
|
|
121
|
+
*
|
|
122
|
+
* @param[in] ptr pointer to the beginning of the memory region to poison.
|
|
123
|
+
* @param[in] size the length of the memory region to poison.
|
|
124
|
+
*/
|
|
125
|
+
static inline void
|
|
126
|
+
asan_poison_memory_region(const volatile void *ptr, size_t size)
|
|
127
|
+
{
|
|
128
|
+
__msan_poison(ptr, size);
|
|
129
|
+
__asan_poison_memory_region(ptr, size);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#ifdef RUBY_ASAN_ENABLED
|
|
133
|
+
#define asan_poison_object_if(ptr, obj) do { \
|
|
134
|
+
if (ptr) rb_asan_poison_object(obj); \
|
|
135
|
+
} while (0)
|
|
136
|
+
#else
|
|
137
|
+
#define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj))
|
|
138
|
+
#endif
|
|
139
|
+
|
|
140
|
+
#ifdef RUBY_ASAN_ENABLED
|
|
141
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
142
|
+
/**
|
|
143
|
+
* This is a variant of asan_poison_memory_region that takes a VALUE.
|
|
144
|
+
*
|
|
145
|
+
* @param[in] obj target object.
|
|
146
|
+
*/
|
|
147
|
+
void rb_asan_poison_object(VALUE obj);
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* This function predicates if the given object is fully addressable or not.
|
|
151
|
+
*
|
|
152
|
+
* @param[in] obj target object.
|
|
153
|
+
* @retval 0 the given object is fully addressable.
|
|
154
|
+
* @retval otherwise pointer to first such byte who is poisoned.
|
|
155
|
+
*/
|
|
156
|
+
void *rb_asan_poisoned_object_p(VALUE obj);
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* This is a variant of asan_unpoison_memory_region that takes a VALUE.
|
|
160
|
+
*
|
|
161
|
+
* @param[in] obj target object.
|
|
162
|
+
* @param[in] malloc_p if the memory region is like a malloc's return value or not.
|
|
163
|
+
*/
|
|
164
|
+
void rb_asan_unpoison_object(VALUE obj, bool newobj_p);
|
|
165
|
+
|
|
166
|
+
RUBY_SYMBOL_EXPORT_END
|
|
167
|
+
#else
|
|
168
|
+
# define rb_asan_poison_object(obj) ((void)obj)
|
|
169
|
+
# define rb_asan_poisoned_object_p(obj) ((void)obj, NULL)
|
|
170
|
+
# define rb_asan_unpoison_object(obj, newobj_p) ((void)obj, (void)newobj_p)
|
|
171
|
+
#endif
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* This function asserts that a (formally poisoned) memory region from ptr to
|
|
175
|
+
* size is now addressable. Write access to such memory region gets allowed.
|
|
176
|
+
* However read access might or might not be possible depending on situations,
|
|
177
|
+
* because the region can have contents of previous usages. That information
|
|
178
|
+
* should be passed by the malloc_p flag. If that is true, the contents of the
|
|
179
|
+
* region is _not_ fully defined (like the return value of malloc behaves).
|
|
180
|
+
* Reading from there is NG; write something first. If malloc_p is false on
|
|
181
|
+
* the other hand, that memory region is fully defined and can be read
|
|
182
|
+
* immediately.
|
|
183
|
+
*
|
|
184
|
+
* @param[in] ptr pointer to the beginning of the memory region to unpoison.
|
|
185
|
+
* @param[in] size the length of the memory region.
|
|
186
|
+
* @param[in] malloc_p if the memory region is like a malloc's return value or not.
|
|
187
|
+
*/
|
|
188
|
+
static inline void
|
|
189
|
+
asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p)
|
|
190
|
+
{
|
|
191
|
+
__asan_unpoison_memory_region(ptr, size);
|
|
192
|
+
if (malloc_p) {
|
|
193
|
+
__msan_allocated_memory(ptr, size);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
__msan_unpoison(ptr, size);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
static inline void *
|
|
201
|
+
asan_unpoison_object_temporary(VALUE obj)
|
|
202
|
+
{
|
|
203
|
+
void *ptr = rb_asan_poisoned_object_p(obj);
|
|
204
|
+
rb_asan_unpoison_object(obj, false);
|
|
205
|
+
return ptr;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static inline void *
|
|
209
|
+
asan_poison_object_restore(VALUE obj, void *ptr)
|
|
210
|
+
{
|
|
211
|
+
if (ptr) {
|
|
212
|
+
rb_asan_poison_object(obj);
|
|
213
|
+
}
|
|
214
|
+
return NULL;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
#define asan_unpoisoning_object(obj) \
|
|
218
|
+
for (void *poisoned = asan_unpoison_object_temporary(obj), \
|
|
219
|
+
*unpoisoning = &poisoned; /* flag to loop just once */ \
|
|
220
|
+
unpoisoning; \
|
|
221
|
+
unpoisoning = asan_poison_object_restore(obj, poisoned))
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
static inline void *
|
|
225
|
+
asan_unpoison_memory_region_temporary(void *ptr, size_t len)
|
|
226
|
+
{
|
|
227
|
+
void *poisoned_ptr = __asan_region_is_poisoned(ptr, len);
|
|
228
|
+
asan_unpoison_memory_region(ptr, len, false);
|
|
229
|
+
return poisoned_ptr;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
static inline void *
|
|
233
|
+
asan_poison_memory_region_restore(void *ptr, size_t len, void *poisoned_ptr)
|
|
234
|
+
{
|
|
235
|
+
if (poisoned_ptr) {
|
|
236
|
+
asan_poison_memory_region(ptr, len);
|
|
237
|
+
}
|
|
238
|
+
return NULL;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
#define asan_unpoisoning_memory_region(ptr, len) \
|
|
242
|
+
for (void *poisoned = asan_unpoison_memory_region_temporary(ptr, len), \
|
|
243
|
+
*unpoisoning = &poisoned; /* flag to loop just once */ \
|
|
244
|
+
unpoisoning; \
|
|
245
|
+
unpoisoning = asan_poison_memory_region_restore(ptr, len, poisoned))
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Checks if the given pointer is on an ASAN fake stack. If so, it returns the
|
|
249
|
+
* address this variable has on the real frame; if not, it returns the origin
|
|
250
|
+
* address unmodified.
|
|
251
|
+
*
|
|
252
|
+
* n.b. - _dereferencing_ the returned address is meaningless and should not
|
|
253
|
+
* be done; even though ASAN reserves space for the variable in both the real and
|
|
254
|
+
* fake stacks, the _value_ of that variable is only in the fake stack.
|
|
255
|
+
*
|
|
256
|
+
* n.b. - this only works for addresses passed in from local variables on the same
|
|
257
|
+
* thread, because the ASAN fake stacks are threadlocal.
|
|
258
|
+
*
|
|
259
|
+
* @param[in] slot the address of some local variable
|
|
260
|
+
* @retval a pointer to something from that frame on the _real_ machine stack
|
|
261
|
+
*/
|
|
262
|
+
static inline void *
|
|
263
|
+
asan_get_real_stack_addr(void* slot)
|
|
264
|
+
{
|
|
265
|
+
VALUE *addr;
|
|
266
|
+
addr = __asan_addr_is_in_fake_stack(__asan_get_current_fake_stack(), slot, NULL, NULL);
|
|
267
|
+
return addr ? addr : slot;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Gets the current thread's fake stack handle, which can be passed into get_fake_stack_extents
|
|
272
|
+
*
|
|
273
|
+
* @retval An opaque value which can be passed to asan_get_fake_stack_extents
|
|
274
|
+
*/
|
|
275
|
+
static inline void *
|
|
276
|
+
asan_get_thread_fake_stack_handle(void)
|
|
277
|
+
{
|
|
278
|
+
return __asan_get_current_fake_stack();
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Checks if the given VALUE _actually_ represents a pointer to an ASAN fake stack.
|
|
283
|
+
*
|
|
284
|
+
* If the given slot _is_ actually a reference to an ASAN fake stack, and that fake stack
|
|
285
|
+
* contains the real values for the passed-in range of machine stack addresses, returns true
|
|
286
|
+
* and the range of the fake stack through the outparams.
|
|
287
|
+
*
|
|
288
|
+
* Otherwise, returns false, and sets the outparams to NULL.
|
|
289
|
+
*
|
|
290
|
+
* Note that this function expects "start" to be > "end" on downward-growing stack architectures;
|
|
291
|
+
*
|
|
292
|
+
* @param[in] thread_fake_stack_handle The asan fake stack reference for the thread we're scanning
|
|
293
|
+
* @param[in] slot The value on the machine stack we want to inspect
|
|
294
|
+
* @param[in] machine_stack_start The extents of the real machine stack on which slot lives
|
|
295
|
+
* @param[in] machine_stack_end The extents of the real machine stack on which slot lives
|
|
296
|
+
* @param[out] fake_stack_start_out The extents of the fake stack which contains real VALUEs
|
|
297
|
+
* @param[out] fake_stack_end_out The extents of the fake stack which contains real VALUEs
|
|
298
|
+
* @return Whether slot is a pointer to a fake stack for the given machine stack range
|
|
299
|
+
*/
|
|
300
|
+
|
|
301
|
+
static inline bool
|
|
302
|
+
asan_get_fake_stack_extents(void *thread_fake_stack_handle, VALUE slot,
|
|
303
|
+
void *machine_stack_start, void *machine_stack_end,
|
|
304
|
+
void **fake_stack_start_out, void **fake_stack_end_out)
|
|
305
|
+
{
|
|
306
|
+
/* the ifdef is needed here to suppress a warning about fake_frame_{start/end} being
|
|
307
|
+
uninitialized if __asan_addr_is_in_fake_stack is an empty macro */
|
|
308
|
+
#ifdef RUBY_ASAN_ENABLED
|
|
309
|
+
void *fake_frame_start;
|
|
310
|
+
void *fake_frame_end;
|
|
311
|
+
void *real_stack_frame = __asan_addr_is_in_fake_stack(
|
|
312
|
+
thread_fake_stack_handle, (void *)slot, &fake_frame_start, &fake_frame_end
|
|
313
|
+
);
|
|
314
|
+
if (real_stack_frame) {
|
|
315
|
+
bool in_range;
|
|
316
|
+
#if STACK_GROW_DIRECTION < 0
|
|
317
|
+
in_range = machine_stack_start >= real_stack_frame && real_stack_frame >= machine_stack_end;
|
|
318
|
+
#else
|
|
319
|
+
in_range = machine_stack_start <= real_stack_frame && real_stack_frame <= machine_stack_end;
|
|
320
|
+
#endif
|
|
321
|
+
if (in_range) {
|
|
322
|
+
*fake_stack_start_out = fake_frame_start;
|
|
323
|
+
*fake_stack_end_out = fake_frame_end;
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
#endif
|
|
328
|
+
*fake_stack_start_out = 0;
|
|
329
|
+
*fake_stack_end_out = 0;
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
extern const char ruby_asan_default_options[];
|
|
334
|
+
|
|
335
|
+
#ifdef RUBY_ASAN_ENABLED
|
|
336
|
+
/* Compile in the ASAN options Ruby needs, rather than relying on environment variables, so
|
|
337
|
+
* that even tests which fork ruby with a clean environment will run ASAN with the right
|
|
338
|
+
* settings */
|
|
339
|
+
# undef RUBY__ASAN_DEFAULT_OPTIONS
|
|
340
|
+
# define RUBY__ASAN_DEFAULT_OPTIONS \
|
|
341
|
+
RBIMPL_SYMBOL_EXPORT_BEGIN() \
|
|
342
|
+
const char * __asan_default_options(void) {return ruby_asan_default_options;} \
|
|
343
|
+
RBIMPL_SYMBOL_EXPORT_END()
|
|
344
|
+
#endif
|
|
345
|
+
|
|
346
|
+
#endif /* INTERNAL_SANITIZERS_H */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#ifndef INTERNAL_SERIAL_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_SERIAL_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 rb_serial_t.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h" /* for HAVE_LONG_LONG */
|
|
12
|
+
#include "ruby/defines.h" /* for LONG_LONG */
|
|
13
|
+
|
|
14
|
+
#ifndef HAVE_LONG_LONG
|
|
15
|
+
# error need C99+
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
typedef unsigned LONG_LONG rb_serial_t;
|
|
19
|
+
#define SERIALT2NUM ULL2NUM
|
|
20
|
+
#define PRI_SERIALT_PREFIX PRI_LL_PREFIX
|
|
21
|
+
#define SIZEOF_SERIAL_T SIZEOF_LONG_LONG
|
|
22
|
+
|
|
23
|
+
#endif /* INTERNAL_SERIAL_H */
|