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,160 @@
|
|
|
1
|
+
#ifndef RUBY_VM_SYNC_H
|
|
2
|
+
#define RUBY_VM_SYNC_H
|
|
3
|
+
|
|
4
|
+
#include "vm_debug.h"
|
|
5
|
+
#include "debug_counter.h"
|
|
6
|
+
|
|
7
|
+
#if USE_RUBY_DEBUG_LOG
|
|
8
|
+
#define LOCATION_ARGS const char *file, int line
|
|
9
|
+
#define LOCATION_PARAMS file, line
|
|
10
|
+
#define APPEND_LOCATION_ARGS , const char *file, int line
|
|
11
|
+
#define APPEND_LOCATION_PARAMS , file, line
|
|
12
|
+
#else
|
|
13
|
+
#define LOCATION_ARGS void
|
|
14
|
+
#define LOCATION_PARAMS
|
|
15
|
+
#define APPEND_LOCATION_ARGS
|
|
16
|
+
#define APPEND_LOCATION_PARAMS
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
bool rb_vm_locked_p(void);
|
|
20
|
+
void rb_vm_lock_body(LOCATION_ARGS);
|
|
21
|
+
void rb_vm_unlock_body(LOCATION_ARGS);
|
|
22
|
+
|
|
23
|
+
struct rb_ractor_struct;
|
|
24
|
+
NOINLINE(void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS));
|
|
25
|
+
NOINLINE(void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS));
|
|
26
|
+
NOINLINE(void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS));
|
|
27
|
+
void rb_vm_lock_leave_body_nb(unsigned int *lev APPEND_LOCATION_ARGS);
|
|
28
|
+
void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS);
|
|
29
|
+
void rb_vm_barrier(void);
|
|
30
|
+
|
|
31
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
32
|
+
VALUE rb_vm_lock_with_barrier(VALUE (*func)(void *args), void *args);
|
|
33
|
+
RUBY_SYMBOL_EXPORT_END
|
|
34
|
+
|
|
35
|
+
#if RUBY_DEBUG
|
|
36
|
+
// GET_VM()
|
|
37
|
+
#include "vm_core.h"
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
|
|
41
|
+
|
|
42
|
+
static inline bool
|
|
43
|
+
rb_multi_ractor_p(void)
|
|
44
|
+
{
|
|
45
|
+
if (LIKELY(ruby_single_main_ractor)) {
|
|
46
|
+
// 0 on boot time.
|
|
47
|
+
RUBY_ASSERT(GET_VM()->ractor.cnt <= 1);
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// multi-ractor mode can run ractor.cnt == 1
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static inline void
|
|
57
|
+
rb_vm_lock(const char *file, int line)
|
|
58
|
+
{
|
|
59
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock);
|
|
60
|
+
|
|
61
|
+
if (rb_multi_ractor_p()) {
|
|
62
|
+
rb_vm_lock_body(LOCATION_PARAMS);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static inline void
|
|
67
|
+
rb_vm_unlock(const char *file, int line)
|
|
68
|
+
{
|
|
69
|
+
if (rb_multi_ractor_p()) {
|
|
70
|
+
rb_vm_unlock_body(LOCATION_PARAMS);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static inline void
|
|
75
|
+
rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
|
|
76
|
+
{
|
|
77
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock_enter);
|
|
78
|
+
|
|
79
|
+
if (rb_multi_ractor_p()) {
|
|
80
|
+
rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static inline void
|
|
85
|
+
rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line)
|
|
86
|
+
{
|
|
87
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb);
|
|
88
|
+
|
|
89
|
+
if (rb_multi_ractor_p()) {
|
|
90
|
+
rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static inline void
|
|
95
|
+
rb_vm_lock_leave_nb(unsigned int *lev, const char *file, int line)
|
|
96
|
+
{
|
|
97
|
+
if (rb_multi_ractor_p()) {
|
|
98
|
+
rb_vm_lock_leave_body_nb(lev APPEND_LOCATION_PARAMS);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
static inline void
|
|
103
|
+
rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
|
|
104
|
+
{
|
|
105
|
+
if (rb_multi_ractor_p()) {
|
|
106
|
+
rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static inline void
|
|
111
|
+
rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
|
|
112
|
+
{
|
|
113
|
+
RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr);
|
|
114
|
+
rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static inline void
|
|
118
|
+
rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
|
|
119
|
+
{
|
|
120
|
+
rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#define RB_VM_LOCKED_P() rb_vm_locked_p()
|
|
124
|
+
|
|
125
|
+
#define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__)
|
|
126
|
+
#define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__)
|
|
127
|
+
|
|
128
|
+
#define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__)
|
|
129
|
+
#define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__)
|
|
130
|
+
#define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__)
|
|
131
|
+
#define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__)
|
|
132
|
+
|
|
133
|
+
#define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev);
|
|
134
|
+
#define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); }
|
|
135
|
+
#define RB_VM_LOCKING() \
|
|
136
|
+
for (unsigned int vm_locking_level, vm_locking_do = (RB_VM_LOCK_ENTER_LEV(&vm_locking_level), 1); \
|
|
137
|
+
vm_locking_do; RB_VM_LOCK_LEAVE_LEV(&vm_locking_level), vm_locking_do = 0)
|
|
138
|
+
|
|
139
|
+
#define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__)
|
|
140
|
+
#define RB_VM_LOCK_LEAVE_LEV_NB(levp) rb_vm_lock_leave_nb(levp, __FILE__, __LINE__)
|
|
141
|
+
#define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev);
|
|
142
|
+
#define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV_NB(&_lev); }
|
|
143
|
+
#define RB_VM_LOCKING_NO_BARRIER() \
|
|
144
|
+
for (unsigned int vm_locking_level, vm_locking_do = (RB_VM_LOCK_ENTER_LEV_NB(&vm_locking_level), 1); \
|
|
145
|
+
vm_locking_do; RB_VM_LOCK_LEAVE_LEV_NB(&vm_locking_level), vm_locking_do = 0)
|
|
146
|
+
|
|
147
|
+
#if RUBY_DEBUG > 0
|
|
148
|
+
void RUBY_ASSERT_vm_locking(void);
|
|
149
|
+
void RUBY_ASSERT_vm_locking_with_barrier(void);
|
|
150
|
+
void RUBY_ASSERT_vm_unlocking(void);
|
|
151
|
+
#define ASSERT_vm_locking() RUBY_ASSERT_vm_locking()
|
|
152
|
+
#define ASSERT_vm_locking_with_barrier() RUBY_ASSERT_vm_locking_with_barrier()
|
|
153
|
+
#define ASSERT_vm_unlocking() RUBY_ASSERT_vm_unlocking()
|
|
154
|
+
#else
|
|
155
|
+
#define ASSERT_vm_locking()
|
|
156
|
+
#define ASSERT_vm_locking_with_barrier()
|
|
157
|
+
#define ASSERT_vm_unlocking()
|
|
158
|
+
#endif
|
|
159
|
+
|
|
160
|
+
#endif // RUBY_VM_SYNC_H
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
|
|
2
|
+
#ifndef CCAN_BUILD_ASSERT_H
|
|
3
|
+
#define CCAN_BUILD_ASSERT_H
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CCAN_BUILD_ASSERT - assert a build-time dependency.
|
|
7
|
+
* @cond: the compile-time condition which must be true.
|
|
8
|
+
*
|
|
9
|
+
* Your compile will fail if the condition isn't true, or can't be evaluated
|
|
10
|
+
* by the compiler. This can only be used within a function.
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* #include <stddef.h>
|
|
14
|
+
* ...
|
|
15
|
+
* static char *foo_to_char(struct foo *foo)
|
|
16
|
+
* {
|
|
17
|
+
* // This code needs string to be at start of foo.
|
|
18
|
+
* CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0);
|
|
19
|
+
* return (char *)foo;
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
#define CCAN_BUILD_ASSERT(cond) \
|
|
23
|
+
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
|
|
27
|
+
* @cond: the compile-time condition which must be true.
|
|
28
|
+
*
|
|
29
|
+
* Your compile will fail if the condition isn't true, or can't be evaluated
|
|
30
|
+
* by the compiler. This can be used in an expression: its value is "0".
|
|
31
|
+
*
|
|
32
|
+
* Example:
|
|
33
|
+
* #define foo_to_char(foo) \
|
|
34
|
+
* ((char *)(foo) \
|
|
35
|
+
* + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
|
|
36
|
+
*/
|
|
37
|
+
#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \
|
|
38
|
+
(sizeof(char [1 - 2*!(cond)]) - 1)
|
|
39
|
+
|
|
40
|
+
#endif /* CCAN_BUILD_ASSERT_H */
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
|
|
2
|
+
#ifndef CCAN_CHECK_TYPE_H
|
|
3
|
+
#define CCAN_CHECK_TYPE_H
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ccan_check_type - issue a warning or build failure if type is not correct.
|
|
7
|
+
* @expr: the expression whose type we should check (not evaluated).
|
|
8
|
+
* @type: the exact type we expect the expression to be.
|
|
9
|
+
*
|
|
10
|
+
* This macro is usually used within other macros to try to ensure that a macro
|
|
11
|
+
* argument is of the expected type. No type promotion of the expression is
|
|
12
|
+
* done: an unsigned int is not the same as an int!
|
|
13
|
+
*
|
|
14
|
+
* ccan_check_type() always evaluates to 0.
|
|
15
|
+
*
|
|
16
|
+
* If your compiler does not support typeof, then the best we can do is fail
|
|
17
|
+
* to compile if the sizes of the types are unequal (a less complete check).
|
|
18
|
+
*
|
|
19
|
+
* Example:
|
|
20
|
+
* // They should always pass a 64-bit value to _set_some_value!
|
|
21
|
+
* #define set_some_value(expr) \
|
|
22
|
+
* _set_some_value((ccan_check_type((expr), uint64_t), (expr)))
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* ccan_check_types_match - issue a warning or build failure if types are not same.
|
|
27
|
+
* @expr1: the first expression (not evaluated).
|
|
28
|
+
* @expr2: the second expression (not evaluated).
|
|
29
|
+
*
|
|
30
|
+
* This macro is usually used within other macros to try to ensure that
|
|
31
|
+
* arguments are of identical types. No type promotion of the expressions is
|
|
32
|
+
* done: an unsigned int is not the same as an int!
|
|
33
|
+
*
|
|
34
|
+
* ccan_check_types_match() always evaluates to 0.
|
|
35
|
+
*
|
|
36
|
+
* If your compiler does not support typeof, then the best we can do is fail
|
|
37
|
+
* to compile if the sizes of the types are unequal (a less complete check).
|
|
38
|
+
*
|
|
39
|
+
* Example:
|
|
40
|
+
* // Do subtraction to get to enclosing type, but make sure that
|
|
41
|
+
* // pointer is of correct type for that member.
|
|
42
|
+
* #define ccan_container_of(mbr_ptr, encl_type, mbr) \
|
|
43
|
+
* (ccan_check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
|
|
44
|
+
* ((encl_type *) \
|
|
45
|
+
* ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
|
|
46
|
+
*/
|
|
47
|
+
#if defined(HAVE_TYPEOF) && HAVE_TYPEOF
|
|
48
|
+
#define ccan_check_type(expr, type) \
|
|
49
|
+
((typeof(expr) *)0 != (type *)0)
|
|
50
|
+
|
|
51
|
+
#define ccan_check_types_match(expr1, expr2) \
|
|
52
|
+
((typeof(expr1) *)0 != (typeof(expr2) *)0)
|
|
53
|
+
#else
|
|
54
|
+
#include "ccan/build_assert/build_assert.h"
|
|
55
|
+
/* Without typeof, we can only test the sizes. */
|
|
56
|
+
#define ccan_check_type(expr, type) \
|
|
57
|
+
CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
|
|
58
|
+
|
|
59
|
+
#define ccan_check_types_match(expr1, expr2) \
|
|
60
|
+
CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
|
|
61
|
+
#endif /* HAVE_TYPEOF */
|
|
62
|
+
|
|
63
|
+
#endif /* CCAN_CHECK_TYPE_H */
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
|
|
2
|
+
#ifndef CCAN_CONTAINER_OF_H
|
|
3
|
+
#define CCAN_CONTAINER_OF_H
|
|
4
|
+
#include "ccan/check_type/check_type.h"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ccan_container_of - get pointer to enclosing structure
|
|
8
|
+
* @member_ptr: pointer to the structure member
|
|
9
|
+
* @containing_type: the type this member is within
|
|
10
|
+
* @member: the name of this member within the structure.
|
|
11
|
+
*
|
|
12
|
+
* Given a pointer to a member of a structure, this macro does pointer
|
|
13
|
+
* subtraction to return the pointer to the enclosing type.
|
|
14
|
+
*
|
|
15
|
+
* Example:
|
|
16
|
+
* struct foo {
|
|
17
|
+
* int fielda, fieldb;
|
|
18
|
+
* // ...
|
|
19
|
+
* };
|
|
20
|
+
* struct info {
|
|
21
|
+
* int some_other_field;
|
|
22
|
+
* struct foo my_foo;
|
|
23
|
+
* };
|
|
24
|
+
*
|
|
25
|
+
* static struct info *foo_to_info(struct foo *foo)
|
|
26
|
+
* {
|
|
27
|
+
* return ccan_container_of(foo, struct info, my_foo);
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
#define ccan_container_of(member_ptr, containing_type, member) \
|
|
31
|
+
((containing_type *) \
|
|
32
|
+
((char *)(member_ptr) \
|
|
33
|
+
- ccan_container_off(containing_type, member)) \
|
|
34
|
+
+ ccan_check_types_match(*(member_ptr), ((containing_type *)0)->member))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* ccan_container_of_or_null - get pointer to enclosing structure, or NULL
|
|
39
|
+
* @member_ptr: pointer to the structure member
|
|
40
|
+
* @containing_type: the type this member is within
|
|
41
|
+
* @member: the name of this member within the structure.
|
|
42
|
+
*
|
|
43
|
+
* Given a pointer to a member of a structure, this macro does pointer
|
|
44
|
+
* subtraction to return the pointer to the enclosing type, unless it
|
|
45
|
+
* is given NULL, in which case it also returns NULL.
|
|
46
|
+
*
|
|
47
|
+
* Example:
|
|
48
|
+
* struct foo {
|
|
49
|
+
* int fielda, fieldb;
|
|
50
|
+
* // ...
|
|
51
|
+
* };
|
|
52
|
+
* struct info {
|
|
53
|
+
* int some_other_field;
|
|
54
|
+
* struct foo my_foo;
|
|
55
|
+
* };
|
|
56
|
+
*
|
|
57
|
+
* static struct info *foo_to_info_allowing_null(struct foo *foo)
|
|
58
|
+
* {
|
|
59
|
+
* return ccan_container_of_or_null(foo, struct info, my_foo);
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
static inline char *container_of_or_null_(void *member_ptr, size_t offset)
|
|
63
|
+
{
|
|
64
|
+
return member_ptr ? (char *)member_ptr - offset : NULL;
|
|
65
|
+
}
|
|
66
|
+
#define ccan_container_of_or_null(member_ptr, containing_type, member) \
|
|
67
|
+
((containing_type *) \
|
|
68
|
+
ccan_container_of_or_null_(member_ptr, \
|
|
69
|
+
ccan_container_off(containing_type, member)) \
|
|
70
|
+
+ ccan_check_types_match(*(member_ptr), ((containing_type *)0)->member))
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* ccan_container_off - get offset to enclosing structure
|
|
74
|
+
* @containing_type: the type this member is within
|
|
75
|
+
* @member: the name of this member within the structure.
|
|
76
|
+
*
|
|
77
|
+
* Given a pointer to a member of a structure, this macro does
|
|
78
|
+
* typechecking and figures out the offset to the enclosing type.
|
|
79
|
+
*
|
|
80
|
+
* Example:
|
|
81
|
+
* struct foo {
|
|
82
|
+
* int fielda, fieldb;
|
|
83
|
+
* // ...
|
|
84
|
+
* };
|
|
85
|
+
* struct info {
|
|
86
|
+
* int some_other_field;
|
|
87
|
+
* struct foo my_foo;
|
|
88
|
+
* };
|
|
89
|
+
*
|
|
90
|
+
* static struct info *foo_to_info(struct foo *foo)
|
|
91
|
+
* {
|
|
92
|
+
* size_t off = ccan_container_off(struct info, my_foo);
|
|
93
|
+
* return (void *)((char *)foo - off);
|
|
94
|
+
* }
|
|
95
|
+
*/
|
|
96
|
+
#define ccan_container_off(containing_type, member) \
|
|
97
|
+
offsetof(containing_type, member)
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* ccan_container_of_var - get pointer to enclosing structure using a variable
|
|
101
|
+
* @member_ptr: pointer to the structure member
|
|
102
|
+
* @container_var: a pointer of same type as this member's container
|
|
103
|
+
* @member: the name of this member within the structure.
|
|
104
|
+
*
|
|
105
|
+
* Given a pointer to a member of a structure, this macro does pointer
|
|
106
|
+
* subtraction to return the pointer to the enclosing type.
|
|
107
|
+
*
|
|
108
|
+
* Example:
|
|
109
|
+
* static struct info *foo_to_i(struct foo *foo)
|
|
110
|
+
* {
|
|
111
|
+
* struct info *i = ccan_container_of_var(foo, i, my_foo);
|
|
112
|
+
* return i;
|
|
113
|
+
* }
|
|
114
|
+
*/
|
|
115
|
+
#if defined(HAVE_TYPEOF) && HAVE_TYPEOF
|
|
116
|
+
#define ccan_container_of_var(member_ptr, container_var, member) \
|
|
117
|
+
ccan_container_of(member_ptr, typeof(*container_var), member)
|
|
118
|
+
#else
|
|
119
|
+
#define ccan_container_of_var(member_ptr, container_var, member) \
|
|
120
|
+
((void *)((char *)(member_ptr) - \
|
|
121
|
+
ccan_container_off_var(container_var, member)))
|
|
122
|
+
#endif
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* ccan_container_off_var - get offset of a field in enclosing structure
|
|
126
|
+
* @container_var: a pointer to a container structure
|
|
127
|
+
* @member: the name of a member within the structure.
|
|
128
|
+
*
|
|
129
|
+
* Given (any) pointer to a structure and a its member name, this
|
|
130
|
+
* macro does pointer subtraction to return offset of member in a
|
|
131
|
+
* structure memory layout.
|
|
132
|
+
*
|
|
133
|
+
*/
|
|
134
|
+
#if defined(HAVE_TYPEOF) && HAVE_TYPEOF
|
|
135
|
+
#define ccan_container_off_var(var, member) \
|
|
136
|
+
ccan_container_off(typeof(*var), member)
|
|
137
|
+
#else
|
|
138
|
+
#define ccan_container_off_var(var, member) \
|
|
139
|
+
((const char *)&(var)->member - (const char *)(var))
|
|
140
|
+
#endif
|
|
141
|
+
|
|
142
|
+
#endif /* CCAN_CONTAINER_OF_H */
|