ruby_memprofiler_pprof 0.0.3 → 0.0.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/ext/ruby_memprofiler_pprof_ext/collector.c +803 -0
- data/ext/ruby_memprofiler_pprof_ext/compat.c +184 -0
- data/ext/ruby_memprofiler_pprof_ext/compile_commands.json +1 -0
- data/ext/ruby_memprofiler_pprof_ext/extconf.rb +152 -0
- data/ext/ruby_memprofiler_pprof_ext/pprof.upb.c +199 -0
- data/ext/ruby_memprofiler_pprof_ext/pprof.upb.h +924 -0
- data/ext/ruby_memprofiler_pprof_ext/pprof_out.c +430 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_hacks.c +118 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_memprofiler_pprof.c +10 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_memprofiler_pprof.h +183 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_private/ruby26/gc_private.h +324 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_private/ruby27/gc_private.h +339 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_private/ruby30/gc_private.h +361 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_private/ruby31/gc_private.h +374 -0
- data/ext/ruby_memprofiler_pprof_ext/ruby_private.h +31 -0
- data/ext/ruby_memprofiler_pprof_ext/sample.c +43 -0
- data/ext/ruby_memprofiler_pprof_ext/vendor/backtracie/backtracie.h +268 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/CONTRIBUTING.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/DESIGN.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/LICENSE +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/README.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/WORKSPACE +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/amalgamate.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/build_defs.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/lua.BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/protobuf.patch +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/py_proto_library.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/python_downloads.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/system_python.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/upb_proto_library.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/bazel/workspace_deps.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/BUILD.googleapis +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/benchmark.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/build_defs.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/compare.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/descriptor.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/descriptor_sv.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/empty.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/gen_protobuf_binary_cc.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/gen_synthetic_protos.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/benchmarks/gen_upb_binary_c.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/cmake/BUILD.bazel +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/cmake/README.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/cmake/build_defs.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/cmake/make_cmakelists.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/cmake/staleness_test.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/cmake/staleness_test_lib.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/docs/render.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/docs/style-guide.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/docs/vs-cpp-protos.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/docs/wrapping-upb.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/convert.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/convert.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/descriptor.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/descriptor.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/descriptor_containers.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/descriptor_containers.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/descriptor_pool.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/descriptor_pool.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/dist/BUILD.bazel +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/dist/dist.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/extension_dict.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/extension_dict.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/map.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/map.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/message.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/message.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/minimal_test.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/README.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/descriptor_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/generator_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/json_format_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/keywords_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/message_factory_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/message_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/proto_builder_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/reflection_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/service_reflection_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/symbol_database_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/text_encoding_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/text_format_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/well_known_types_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/pb_unit_tests/wire_format_test_wrapper.py +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/protobuf.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/protobuf.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/py_extension.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/python_api.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/repeated.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/repeated.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/unknown_fields.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/unknown_fields.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/python/version_script.lds +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/lunit/LICENSE +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/lunit/README.google +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/lunit/console.lua +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/lunit/lunit.lua +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/utf8_range/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/utf8_range/LICENSE +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/utf8_range/naive.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/utf8_range/range2-neon.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/utf8_range/range2-sse.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/third_party/utf8_range/utf8_range.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/BUILD.bazel +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/README.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/def.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/lua_proto_library.bzl +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/main.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/msg.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/test_upb.lua +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/upb.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/upb.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/upb.lua +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/bindings/lua/upbc.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/collections.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/collections.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/conformance_upb.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/conformance_upb_failures.txt +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/decode.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/decode.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/decode_fast.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/decode_fast.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/decode_internal.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/def.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/def.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/def.hpp +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/empty.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/encode.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/encode.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/fuzz/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/fuzz/file_descriptor_parsenew_fuzzer.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/json_decode.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/json_decode.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/json_encode.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/json_encode.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table.hpp +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table_accessors.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table_accessors.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table_accessors_internal.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table_accessors_test.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/mini_table_test.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/msg.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/msg.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/msg_internal.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/msg_test.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/msg_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/port_def.inc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/port_undef.inc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/reflection.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/reflection.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/reflection.hpp +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/table.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/table_internal.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/test_cpp.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/test_cpp.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/test_generated_code.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/test_table.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/text_encode.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/text_encode.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/upb.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/upb.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/upb.hpp +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/upb_internal.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/README.md +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/compare.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/compare.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/compare_test.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto_public_import_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto_regular_import_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto_test.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto_weak_import_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/def_to_proto_wweak_import_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/required_fields.c +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/required_fields.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/required_fields_test.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upb/util/required_fields_test.proto +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upbc/BUILD +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upbc/common.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upbc/common.h +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upbc/protoc-gen-upb.cc +0 -0
- data/ext/{ruby_memprofiler_pprof → ruby_memprofiler_pprof_ext}/vendor/upb/upbc/protoc-gen-upbdefs.cc +0 -0
- data/lib/ruby_memprofiler_pprof/atfork.rb +1 -1
- data/lib/ruby_memprofiler_pprof/block_flusher.rb +48 -4
- data/lib/ruby_memprofiler_pprof/file_flusher.rb +13 -6
- data/lib/ruby_memprofiler_pprof/profile_app.rb +8 -12
- data/lib/ruby_memprofiler_pprof/profile_data.rb +7 -8
- data/lib/ruby_memprofiler_pprof/version.rb +1 -1
- data/lib/ruby_memprofiler_pprof.rb +5 -4
- data/libexec/ruby_memprofiler_pprof_profile +6 -6
- metadata +207 -200
- data/ext/ruby_memprofiler_pprof/backtrace.c +0 -429
- data/ext/ruby_memprofiler_pprof/collector.c +0 -1055
- data/ext/ruby_memprofiler_pprof/compat.c +0 -182
- data/ext/ruby_memprofiler_pprof/extconf.rb +0 -72
- data/ext/ruby_memprofiler_pprof/pprof.upb.c +0 -170
- data/ext/ruby_memprofiler_pprof/pprof.upb.h +0 -848
- data/ext/ruby_memprofiler_pprof/pprof_out.c +0 -285
- data/ext/ruby_memprofiler_pprof/ruby_memprofiler_pprof.c +0 -11
- data/ext/ruby_memprofiler_pprof/ruby_memprofiler_pprof.h +0 -301
- data/ext/ruby_memprofiler_pprof/strtab.c +0 -391
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
#ifndef GC_PRIVATE_H
|
|
2
|
+
#define GC_PRIVATE_H
|
|
3
|
+
|
|
4
|
+
typedef struct RVALUE {
|
|
5
|
+
union {
|
|
6
|
+
struct {
|
|
7
|
+
VALUE flags; /* always 0 for freed obj */
|
|
8
|
+
struct RVALUE *next;
|
|
9
|
+
} free;
|
|
10
|
+
struct RMoved moved;
|
|
11
|
+
struct RBasic basic;
|
|
12
|
+
struct RObject object;
|
|
13
|
+
struct RClass klass;
|
|
14
|
+
struct RFloat flonum;
|
|
15
|
+
struct RString string;
|
|
16
|
+
struct RArray array;
|
|
17
|
+
struct RRegexp regexp;
|
|
18
|
+
struct RHash hash;
|
|
19
|
+
struct RData data;
|
|
20
|
+
struct RTypedData typeddata;
|
|
21
|
+
struct RStruct rstruct;
|
|
22
|
+
struct RBignum bignum;
|
|
23
|
+
struct RFile file;
|
|
24
|
+
struct RMatch match;
|
|
25
|
+
struct RRational rational;
|
|
26
|
+
struct RComplex complex;
|
|
27
|
+
union {
|
|
28
|
+
rb_cref_t cref;
|
|
29
|
+
struct vm_svar svar;
|
|
30
|
+
struct vm_throw_data throw_data;
|
|
31
|
+
struct vm_ifunc ifunc;
|
|
32
|
+
struct MEMO memo;
|
|
33
|
+
struct rb_method_entry_struct ment;
|
|
34
|
+
const rb_iseq_t iseq;
|
|
35
|
+
rb_env_t env;
|
|
36
|
+
struct rb_imemo_tmpbuf_struct alloc;
|
|
37
|
+
rb_ast_t ast;
|
|
38
|
+
} imemo;
|
|
39
|
+
struct {
|
|
40
|
+
struct RBasic basic;
|
|
41
|
+
VALUE v1;
|
|
42
|
+
VALUE v2;
|
|
43
|
+
VALUE v3;
|
|
44
|
+
} values;
|
|
45
|
+
} as;
|
|
46
|
+
#if GC_DEBUG
|
|
47
|
+
const char *file;
|
|
48
|
+
int line;
|
|
49
|
+
#endif
|
|
50
|
+
} RVALUE;
|
|
51
|
+
|
|
52
|
+
#define RANY(o) ((RVALUE*)(o))
|
|
53
|
+
#define STACK_CHUNK_SIZE 500
|
|
54
|
+
|
|
55
|
+
typedef struct stack_chunk {
|
|
56
|
+
VALUE data[STACK_CHUNK_SIZE];
|
|
57
|
+
struct stack_chunk *next;
|
|
58
|
+
} stack_chunk_t;
|
|
59
|
+
|
|
60
|
+
typedef struct mark_stack {
|
|
61
|
+
stack_chunk_t *chunk;
|
|
62
|
+
stack_chunk_t *cache;
|
|
63
|
+
int index;
|
|
64
|
+
int limit;
|
|
65
|
+
size_t cache_size;
|
|
66
|
+
size_t unused_cache_size;
|
|
67
|
+
} mark_stack_t;
|
|
68
|
+
|
|
69
|
+
typedef uintptr_t bits_t;
|
|
70
|
+
enum {
|
|
71
|
+
BITS_SIZE = sizeof(bits_t),
|
|
72
|
+
BITS_BITLENGTH = ( BITS_SIZE * CHAR_BIT )
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
struct heap_page_header {
|
|
76
|
+
struct heap_page *page;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
struct heap_page_body {
|
|
80
|
+
struct heap_page_header header;
|
|
81
|
+
/* char gap[]; */
|
|
82
|
+
/* RVALUE values[]; */
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
#define HEAP_PAGE_ALIGN_LOG 14
|
|
86
|
+
#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
|
|
87
|
+
enum {
|
|
88
|
+
HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
|
|
89
|
+
HEAP_PAGE_ALIGN_MASK = (~(~0UL << HEAP_PAGE_ALIGN_LOG)),
|
|
90
|
+
REQUIRED_SIZE_BY_MALLOC = (sizeof(size_t) * 5),
|
|
91
|
+
HEAP_PAGE_SIZE = (HEAP_PAGE_ALIGN - REQUIRED_SIZE_BY_MALLOC),
|
|
92
|
+
HEAP_PAGE_OBJ_LIMIT = (unsigned int)((HEAP_PAGE_SIZE - sizeof(struct heap_page_header))/sizeof(struct RVALUE)),
|
|
93
|
+
HEAP_PAGE_BITMAP_LIMIT = CEILDIV(CEILDIV(HEAP_PAGE_SIZE, sizeof(struct RVALUE)), BITS_BITLENGTH),
|
|
94
|
+
HEAP_PAGE_BITMAP_SIZE = (BITS_SIZE * HEAP_PAGE_BITMAP_LIMIT),
|
|
95
|
+
HEAP_PAGE_BITMAP_PLANES = USE_RGENGC ? 4 : 1 /* RGENGC: mark, unprotected, uncollectible, marking */
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
struct heap_page {
|
|
99
|
+
short total_slots;
|
|
100
|
+
short free_slots;
|
|
101
|
+
short pinned_slots;
|
|
102
|
+
short final_slots;
|
|
103
|
+
struct {
|
|
104
|
+
unsigned int before_sweep : 1;
|
|
105
|
+
unsigned int has_remembered_objects : 1;
|
|
106
|
+
unsigned int has_uncollectible_shady_objects : 1;
|
|
107
|
+
unsigned int in_tomb : 1;
|
|
108
|
+
} flags;
|
|
109
|
+
|
|
110
|
+
struct heap_page *free_next;
|
|
111
|
+
RVALUE *start;
|
|
112
|
+
RVALUE *freelist;
|
|
113
|
+
struct list_node page_node;
|
|
114
|
+
|
|
115
|
+
#if USE_RGENGC
|
|
116
|
+
bits_t wb_unprotected_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
117
|
+
#endif
|
|
118
|
+
/* the following three bitmaps are cleared at the beginning of full GC */
|
|
119
|
+
bits_t mark_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
120
|
+
#if USE_RGENGC
|
|
121
|
+
bits_t uncollectible_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
122
|
+
bits_t marking_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
123
|
+
#endif
|
|
124
|
+
|
|
125
|
+
/* If set, the object is not movable */
|
|
126
|
+
bits_t pinned_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
typedef struct rb_heap_struct {
|
|
131
|
+
RVALUE *freelist;
|
|
132
|
+
|
|
133
|
+
struct heap_page *free_pages;
|
|
134
|
+
struct heap_page *using_page;
|
|
135
|
+
struct list_head pages;
|
|
136
|
+
struct heap_page *sweeping_page; /* iterator for .pages */
|
|
137
|
+
#if GC_ENABLE_INCREMENTAL_MARK
|
|
138
|
+
struct heap_page *pooled_pages;
|
|
139
|
+
#endif
|
|
140
|
+
size_t total_pages; /* total page count in a heap */
|
|
141
|
+
size_t total_slots; /* total slot count (about total_pages * HEAP_PAGE_OBJ_LIMIT) */
|
|
142
|
+
} rb_heap_t;
|
|
143
|
+
|
|
144
|
+
typedef struct gc_profile_record {
|
|
145
|
+
int flags;
|
|
146
|
+
|
|
147
|
+
double gc_time;
|
|
148
|
+
double gc_invoke_time;
|
|
149
|
+
|
|
150
|
+
size_t heap_total_objects;
|
|
151
|
+
size_t heap_use_size;
|
|
152
|
+
size_t heap_total_size;
|
|
153
|
+
|
|
154
|
+
#if GC_PROFILE_MORE_DETAIL
|
|
155
|
+
double gc_mark_time;
|
|
156
|
+
double gc_sweep_time;
|
|
157
|
+
|
|
158
|
+
size_t heap_use_pages;
|
|
159
|
+
size_t heap_live_objects;
|
|
160
|
+
size_t heap_free_objects;
|
|
161
|
+
|
|
162
|
+
size_t allocate_increase;
|
|
163
|
+
size_t allocate_limit;
|
|
164
|
+
|
|
165
|
+
double prepare_time;
|
|
166
|
+
size_t removing_objects;
|
|
167
|
+
size_t empty_objects;
|
|
168
|
+
#if GC_PROFILE_DETAIL_MEMORY
|
|
169
|
+
long maxrss;
|
|
170
|
+
long minflt;
|
|
171
|
+
long majflt;
|
|
172
|
+
#endif
|
|
173
|
+
#endif
|
|
174
|
+
#if MALLOC_ALLOCATED_SIZE
|
|
175
|
+
size_t allocated_size;
|
|
176
|
+
#endif
|
|
177
|
+
|
|
178
|
+
#if RGENGC_PROFILE > 0
|
|
179
|
+
size_t old_objects;
|
|
180
|
+
size_t remembered_normal_objects;
|
|
181
|
+
size_t remembered_shady_objects;
|
|
182
|
+
#endif
|
|
183
|
+
} gc_profile_record;
|
|
184
|
+
|
|
185
|
+
typedef struct rb_objspace {
|
|
186
|
+
struct {
|
|
187
|
+
size_t limit;
|
|
188
|
+
size_t increase;
|
|
189
|
+
#if MALLOC_ALLOCATED_SIZE
|
|
190
|
+
size_t allocated_size;
|
|
191
|
+
size_t allocations;
|
|
192
|
+
#endif
|
|
193
|
+
} malloc_params;
|
|
194
|
+
|
|
195
|
+
struct {
|
|
196
|
+
unsigned int mode : 2;
|
|
197
|
+
unsigned int immediate_sweep : 1;
|
|
198
|
+
unsigned int dont_gc : 1;
|
|
199
|
+
unsigned int dont_incremental : 1;
|
|
200
|
+
unsigned int during_gc : 1;
|
|
201
|
+
unsigned int during_compacting : 1;
|
|
202
|
+
unsigned int gc_stressful: 1;
|
|
203
|
+
unsigned int has_hook: 1;
|
|
204
|
+
#if USE_RGENGC
|
|
205
|
+
unsigned int during_minor_gc : 1;
|
|
206
|
+
#endif
|
|
207
|
+
#if GC_ENABLE_INCREMENTAL_MARK
|
|
208
|
+
unsigned int during_incremental_marking : 1;
|
|
209
|
+
#endif
|
|
210
|
+
} flags;
|
|
211
|
+
|
|
212
|
+
rb_event_flag_t hook_events;
|
|
213
|
+
size_t total_allocated_objects;
|
|
214
|
+
VALUE next_object_id;
|
|
215
|
+
|
|
216
|
+
rb_heap_t eden_heap;
|
|
217
|
+
rb_heap_t tomb_heap; /* heap for zombies and ghosts */
|
|
218
|
+
|
|
219
|
+
struct {
|
|
220
|
+
rb_atomic_t finalizing;
|
|
221
|
+
} atomic_flags;
|
|
222
|
+
|
|
223
|
+
struct mark_func_data_struct {
|
|
224
|
+
void *data;
|
|
225
|
+
void (*mark_func)(VALUE v, void *data);
|
|
226
|
+
} *mark_func_data;
|
|
227
|
+
|
|
228
|
+
mark_stack_t mark_stack;
|
|
229
|
+
size_t marked_slots;
|
|
230
|
+
|
|
231
|
+
struct {
|
|
232
|
+
struct heap_page **sorted;
|
|
233
|
+
size_t allocated_pages;
|
|
234
|
+
size_t allocatable_pages;
|
|
235
|
+
size_t sorted_length;
|
|
236
|
+
RVALUE *range[2];
|
|
237
|
+
size_t freeable_pages;
|
|
238
|
+
|
|
239
|
+
/* final */
|
|
240
|
+
size_t final_slots;
|
|
241
|
+
VALUE deferred_final;
|
|
242
|
+
} heap_pages;
|
|
243
|
+
|
|
244
|
+
st_table *finalizer_table;
|
|
245
|
+
|
|
246
|
+
struct {
|
|
247
|
+
int run;
|
|
248
|
+
int latest_gc_info;
|
|
249
|
+
gc_profile_record *records;
|
|
250
|
+
gc_profile_record *current_record;
|
|
251
|
+
size_t next_index;
|
|
252
|
+
size_t size;
|
|
253
|
+
|
|
254
|
+
#if GC_PROFILE_MORE_DETAIL
|
|
255
|
+
double prepare_time;
|
|
256
|
+
#endif
|
|
257
|
+
double invoke_time;
|
|
258
|
+
|
|
259
|
+
#if USE_RGENGC
|
|
260
|
+
size_t minor_gc_count;
|
|
261
|
+
size_t major_gc_count;
|
|
262
|
+
size_t compact_count;
|
|
263
|
+
#if RGENGC_PROFILE > 0
|
|
264
|
+
size_t total_generated_normal_object_count;
|
|
265
|
+
size_t total_generated_shady_object_count;
|
|
266
|
+
size_t total_shade_operation_count;
|
|
267
|
+
size_t total_promoted_count;
|
|
268
|
+
size_t total_remembered_normal_object_count;
|
|
269
|
+
size_t total_remembered_shady_object_count;
|
|
270
|
+
|
|
271
|
+
#if RGENGC_PROFILE >= 2
|
|
272
|
+
size_t generated_normal_object_count_types[RUBY_T_MASK];
|
|
273
|
+
size_t generated_shady_object_count_types[RUBY_T_MASK];
|
|
274
|
+
size_t shade_operation_count_types[RUBY_T_MASK];
|
|
275
|
+
size_t promoted_types[RUBY_T_MASK];
|
|
276
|
+
size_t remembered_normal_object_count_types[RUBY_T_MASK];
|
|
277
|
+
size_t remembered_shady_object_count_types[RUBY_T_MASK];
|
|
278
|
+
#endif
|
|
279
|
+
#endif /* RGENGC_PROFILE */
|
|
280
|
+
#endif /* USE_RGENGC */
|
|
281
|
+
|
|
282
|
+
/* temporary profiling space */
|
|
283
|
+
double gc_sweep_start_time;
|
|
284
|
+
size_t total_allocated_objects_at_gc_start;
|
|
285
|
+
size_t heap_used_at_gc_start;
|
|
286
|
+
|
|
287
|
+
/* basic statistics */
|
|
288
|
+
size_t count;
|
|
289
|
+
size_t total_freed_objects;
|
|
290
|
+
size_t total_allocated_pages;
|
|
291
|
+
size_t total_freed_pages;
|
|
292
|
+
} profile;
|
|
293
|
+
struct gc_list *global_list;
|
|
294
|
+
|
|
295
|
+
VALUE gc_stress_mode;
|
|
296
|
+
|
|
297
|
+
#if USE_RGENGC
|
|
298
|
+
struct {
|
|
299
|
+
VALUE parent_object;
|
|
300
|
+
int need_major_gc;
|
|
301
|
+
size_t last_major_gc;
|
|
302
|
+
size_t uncollectible_wb_unprotected_objects;
|
|
303
|
+
size_t uncollectible_wb_unprotected_objects_limit;
|
|
304
|
+
size_t old_objects;
|
|
305
|
+
size_t old_objects_limit;
|
|
306
|
+
|
|
307
|
+
#if RGENGC_ESTIMATE_OLDMALLOC
|
|
308
|
+
size_t oldmalloc_increase;
|
|
309
|
+
size_t oldmalloc_increase_limit;
|
|
310
|
+
#endif
|
|
311
|
+
|
|
312
|
+
#if RGENGC_CHECK_MODE >= 2
|
|
313
|
+
struct st_table *allrefs_table;
|
|
314
|
+
size_t error_count;
|
|
315
|
+
#endif
|
|
316
|
+
} rgengc;
|
|
317
|
+
|
|
318
|
+
struct {
|
|
319
|
+
size_t considered_count_table[T_MASK];
|
|
320
|
+
size_t moved_count_table[T_MASK];
|
|
321
|
+
} rcompactor;
|
|
322
|
+
|
|
323
|
+
#if GC_ENABLE_INCREMENTAL_MARK
|
|
324
|
+
struct {
|
|
325
|
+
size_t pooled_slots;
|
|
326
|
+
size_t step_slots;
|
|
327
|
+
} rincgc;
|
|
328
|
+
#endif
|
|
329
|
+
#endif /* USE_RGENGC */
|
|
330
|
+
|
|
331
|
+
st_table *id_to_obj_tbl;
|
|
332
|
+
st_table *obj_to_id_tbl;
|
|
333
|
+
|
|
334
|
+
#if GC_DEBUG_STRESS_TO_CLASS
|
|
335
|
+
VALUE stress_to_class;
|
|
336
|
+
#endif
|
|
337
|
+
} rb_objspace_t;
|
|
338
|
+
|
|
339
|
+
#endif
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
#ifndef GC_PRIVATE_H
|
|
2
|
+
#define GC_PRIVATE_H
|
|
3
|
+
|
|
4
|
+
enum {
|
|
5
|
+
RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX,
|
|
6
|
+
RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
|
|
7
|
+
RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
|
|
8
|
+
RSTRUCT_TRANSIENT_FLAG = FL_USER3,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
struct RStruct {
|
|
12
|
+
struct RBasic basic;
|
|
13
|
+
union {
|
|
14
|
+
struct {
|
|
15
|
+
long len;
|
|
16
|
+
const VALUE *ptr;
|
|
17
|
+
} heap;
|
|
18
|
+
const VALUE ary[RSTRUCT_EMBED_LEN_MAX];
|
|
19
|
+
} as;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
struct RMoved {
|
|
23
|
+
VALUE flags;
|
|
24
|
+
VALUE dummy;
|
|
25
|
+
VALUE destination;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
struct RRational {
|
|
29
|
+
struct RBasic basic;
|
|
30
|
+
VALUE num;
|
|
31
|
+
VALUE den;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
struct RComplex {
|
|
35
|
+
struct RBasic basic;
|
|
36
|
+
VALUE real;
|
|
37
|
+
VALUE imag;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
typedef struct RVALUE {
|
|
41
|
+
union {
|
|
42
|
+
struct {
|
|
43
|
+
VALUE flags; /* always 0 for freed obj */
|
|
44
|
+
struct RVALUE *next;
|
|
45
|
+
} free;
|
|
46
|
+
struct RMoved moved;
|
|
47
|
+
struct RBasic basic;
|
|
48
|
+
struct RObject object;
|
|
49
|
+
struct RClass klass;
|
|
50
|
+
struct RFloat flonum;
|
|
51
|
+
struct RString string;
|
|
52
|
+
struct RArray array;
|
|
53
|
+
struct RRegexp regexp;
|
|
54
|
+
struct RHash hash;
|
|
55
|
+
struct RData data;
|
|
56
|
+
struct RTypedData typeddata;
|
|
57
|
+
struct RStruct rstruct;
|
|
58
|
+
struct RBignum bignum;
|
|
59
|
+
struct RFile file;
|
|
60
|
+
struct RMatch match;
|
|
61
|
+
struct RRational rational;
|
|
62
|
+
struct RComplex complex;
|
|
63
|
+
union {
|
|
64
|
+
rb_cref_t cref;
|
|
65
|
+
struct vm_svar svar;
|
|
66
|
+
struct vm_throw_data throw_data;
|
|
67
|
+
struct vm_ifunc ifunc;
|
|
68
|
+
struct MEMO memo;
|
|
69
|
+
struct rb_method_entry_struct ment;
|
|
70
|
+
const rb_iseq_t iseq;
|
|
71
|
+
rb_env_t env;
|
|
72
|
+
struct rb_imemo_tmpbuf_struct alloc;
|
|
73
|
+
rb_ast_t ast;
|
|
74
|
+
} imemo;
|
|
75
|
+
struct {
|
|
76
|
+
struct RBasic basic;
|
|
77
|
+
VALUE v1;
|
|
78
|
+
VALUE v2;
|
|
79
|
+
VALUE v3;
|
|
80
|
+
} values;
|
|
81
|
+
} as;
|
|
82
|
+
#if GC_DEBUG
|
|
83
|
+
const char *file;
|
|
84
|
+
int line;
|
|
85
|
+
#endif
|
|
86
|
+
} RVALUE;
|
|
87
|
+
|
|
88
|
+
#define RANY(o) ((RVALUE*)(o))
|
|
89
|
+
#define STACK_CHUNK_SIZE 500
|
|
90
|
+
|
|
91
|
+
typedef struct stack_chunk {
|
|
92
|
+
VALUE data[STACK_CHUNK_SIZE];
|
|
93
|
+
struct stack_chunk *next;
|
|
94
|
+
} stack_chunk_t;
|
|
95
|
+
|
|
96
|
+
typedef struct mark_stack {
|
|
97
|
+
stack_chunk_t *chunk;
|
|
98
|
+
stack_chunk_t *cache;
|
|
99
|
+
int index;
|
|
100
|
+
int limit;
|
|
101
|
+
size_t cache_size;
|
|
102
|
+
size_t unused_cache_size;
|
|
103
|
+
} mark_stack_t;
|
|
104
|
+
|
|
105
|
+
typedef uintptr_t bits_t;
|
|
106
|
+
enum {
|
|
107
|
+
BITS_SIZE = sizeof(bits_t),
|
|
108
|
+
BITS_BITLENGTH = ( BITS_SIZE * CHAR_BIT )
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
struct heap_page_header {
|
|
112
|
+
struct heap_page *page;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
struct heap_page_body {
|
|
116
|
+
struct heap_page_header header;
|
|
117
|
+
/* char gap[]; */
|
|
118
|
+
/* RVALUE values[]; */
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
#define HEAP_PAGE_ALIGN_LOG 14
|
|
122
|
+
#define CEILDIV(i, mod) (((i) + (mod) - 1)/(mod))
|
|
123
|
+
enum {
|
|
124
|
+
HEAP_PAGE_ALIGN = (1UL << HEAP_PAGE_ALIGN_LOG),
|
|
125
|
+
HEAP_PAGE_ALIGN_MASK = (~(~0UL << HEAP_PAGE_ALIGN_LOG)),
|
|
126
|
+
HEAP_PAGE_SIZE = HEAP_PAGE_ALIGN,
|
|
127
|
+
HEAP_PAGE_OBJ_LIMIT = (unsigned int)((HEAP_PAGE_SIZE - sizeof(struct heap_page_header))/sizeof(struct RVALUE)),
|
|
128
|
+
HEAP_PAGE_BITMAP_LIMIT = CEILDIV(CEILDIV(HEAP_PAGE_SIZE, sizeof(struct RVALUE)), BITS_BITLENGTH),
|
|
129
|
+
HEAP_PAGE_BITMAP_SIZE = (BITS_SIZE * HEAP_PAGE_BITMAP_LIMIT),
|
|
130
|
+
HEAP_PAGE_BITMAP_PLANES = 4 /* RGENGC: mark, unprotected, uncollectible, marking */
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
struct heap_page {
|
|
134
|
+
short total_slots;
|
|
135
|
+
short free_slots;
|
|
136
|
+
short pinned_slots;
|
|
137
|
+
short final_slots;
|
|
138
|
+
struct {
|
|
139
|
+
unsigned int before_sweep : 1;
|
|
140
|
+
unsigned int has_remembered_objects : 1;
|
|
141
|
+
unsigned int has_uncollectible_shady_objects : 1;
|
|
142
|
+
unsigned int in_tomb : 1;
|
|
143
|
+
} flags;
|
|
144
|
+
|
|
145
|
+
struct heap_page *free_next;
|
|
146
|
+
RVALUE *start;
|
|
147
|
+
RVALUE *freelist;
|
|
148
|
+
struct list_node page_node;
|
|
149
|
+
|
|
150
|
+
bits_t wb_unprotected_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
151
|
+
/* the following three bitmaps are cleared at the beginning of full GC */
|
|
152
|
+
bits_t mark_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
153
|
+
bits_t uncollectible_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
154
|
+
bits_t marking_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
155
|
+
|
|
156
|
+
/* If set, the object is not movable */
|
|
157
|
+
bits_t pinned_bits[HEAP_PAGE_BITMAP_LIMIT];
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
typedef struct rb_heap_struct {
|
|
162
|
+
struct heap_page *free_pages;
|
|
163
|
+
struct list_head pages;
|
|
164
|
+
struct heap_page *sweeping_page; /* iterator for .pages */
|
|
165
|
+
struct heap_page *compact_cursor;
|
|
166
|
+
size_t compact_cursor_index;
|
|
167
|
+
#if GC_ENABLE_INCREMENTAL_MARK
|
|
168
|
+
struct heap_page *pooled_pages;
|
|
169
|
+
#endif
|
|
170
|
+
size_t total_pages; /* total page count in a heap */
|
|
171
|
+
size_t total_slots; /* total slot count (about total_pages * HEAP_PAGE_OBJ_LIMIT) */
|
|
172
|
+
} rb_heap_t;
|
|
173
|
+
|
|
174
|
+
typedef struct gc_profile_record {
|
|
175
|
+
int flags;
|
|
176
|
+
|
|
177
|
+
double gc_time;
|
|
178
|
+
double gc_invoke_time;
|
|
179
|
+
|
|
180
|
+
size_t heap_total_objects;
|
|
181
|
+
size_t heap_use_size;
|
|
182
|
+
size_t heap_total_size;
|
|
183
|
+
size_t moved_objects;
|
|
184
|
+
|
|
185
|
+
#if GC_PROFILE_MORE_DETAIL
|
|
186
|
+
double gc_mark_time;
|
|
187
|
+
double gc_sweep_time;
|
|
188
|
+
|
|
189
|
+
size_t heap_use_pages;
|
|
190
|
+
size_t heap_live_objects;
|
|
191
|
+
size_t heap_free_objects;
|
|
192
|
+
|
|
193
|
+
size_t allocate_increase;
|
|
194
|
+
size_t allocate_limit;
|
|
195
|
+
|
|
196
|
+
double prepare_time;
|
|
197
|
+
size_t removing_objects;
|
|
198
|
+
size_t empty_objects;
|
|
199
|
+
#if GC_PROFILE_DETAIL_MEMORY
|
|
200
|
+
long maxrss;
|
|
201
|
+
long minflt;
|
|
202
|
+
long majflt;
|
|
203
|
+
#endif
|
|
204
|
+
#endif
|
|
205
|
+
#if MALLOC_ALLOCATED_SIZE
|
|
206
|
+
size_t allocated_size;
|
|
207
|
+
#endif
|
|
208
|
+
|
|
209
|
+
#if RGENGC_PROFILE > 0
|
|
210
|
+
size_t old_objects;
|
|
211
|
+
size_t remembered_normal_objects;
|
|
212
|
+
size_t remembered_shady_objects;
|
|
213
|
+
#endif
|
|
214
|
+
} gc_profile_record;
|
|
215
|
+
|
|
216
|
+
typedef struct rb_objspace {
|
|
217
|
+
struct {
|
|
218
|
+
size_t limit;
|
|
219
|
+
size_t increase;
|
|
220
|
+
#if MALLOC_ALLOCATED_SIZE
|
|
221
|
+
size_t allocated_size;
|
|
222
|
+
size_t allocations;
|
|
223
|
+
#endif
|
|
224
|
+
} malloc_params;
|
|
225
|
+
|
|
226
|
+
struct {
|
|
227
|
+
unsigned int mode : 2;
|
|
228
|
+
unsigned int immediate_sweep : 1;
|
|
229
|
+
unsigned int dont_gc : 1;
|
|
230
|
+
unsigned int dont_incremental : 1;
|
|
231
|
+
unsigned int during_gc : 1;
|
|
232
|
+
unsigned int during_compacting : 1;
|
|
233
|
+
unsigned int gc_stressful: 1;
|
|
234
|
+
unsigned int has_hook: 1;
|
|
235
|
+
unsigned int during_minor_gc : 1;
|
|
236
|
+
#if GC_ENABLE_INCREMENTAL_MARK
|
|
237
|
+
unsigned int during_incremental_marking : 1;
|
|
238
|
+
#endif
|
|
239
|
+
} flags;
|
|
240
|
+
|
|
241
|
+
rb_event_flag_t hook_events;
|
|
242
|
+
size_t total_allocated_objects;
|
|
243
|
+
VALUE next_object_id;
|
|
244
|
+
|
|
245
|
+
rb_heap_t eden_heap;
|
|
246
|
+
rb_heap_t tomb_heap; /* heap for zombies and ghosts */
|
|
247
|
+
|
|
248
|
+
struct {
|
|
249
|
+
rb_atomic_t finalizing;
|
|
250
|
+
} atomic_flags;
|
|
251
|
+
|
|
252
|
+
mark_stack_t mark_stack;
|
|
253
|
+
size_t marked_slots;
|
|
254
|
+
|
|
255
|
+
struct {
|
|
256
|
+
struct heap_page **sorted;
|
|
257
|
+
size_t allocated_pages;
|
|
258
|
+
size_t allocatable_pages;
|
|
259
|
+
size_t sorted_length;
|
|
260
|
+
RVALUE *range[2];
|
|
261
|
+
size_t freeable_pages;
|
|
262
|
+
|
|
263
|
+
/* final */
|
|
264
|
+
size_t final_slots;
|
|
265
|
+
VALUE deferred_final;
|
|
266
|
+
} heap_pages;
|
|
267
|
+
|
|
268
|
+
st_table *finalizer_table;
|
|
269
|
+
|
|
270
|
+
struct {
|
|
271
|
+
int run;
|
|
272
|
+
int latest_gc_info;
|
|
273
|
+
gc_profile_record *records;
|
|
274
|
+
gc_profile_record *current_record;
|
|
275
|
+
size_t next_index;
|
|
276
|
+
size_t size;
|
|
277
|
+
|
|
278
|
+
#if GC_PROFILE_MORE_DETAIL
|
|
279
|
+
double prepare_time;
|
|
280
|
+
#endif
|
|
281
|
+
double invoke_time;
|
|
282
|
+
|
|
283
|
+
size_t minor_gc_count;
|
|
284
|
+
size_t major_gc_count;
|
|
285
|
+
size_t compact_count;
|
|
286
|
+
size_t read_barrier_faults;
|
|
287
|
+
#if RGENGC_PROFILE > 0
|
|
288
|
+
size_t total_generated_normal_object_count;
|
|
289
|
+
size_t total_generated_shady_object_count;
|
|
290
|
+
size_t total_shade_operation_count;
|
|
291
|
+
size_t total_promoted_count;
|
|
292
|
+
size_t total_remembered_normal_object_count;
|
|
293
|
+
size_t total_remembered_shady_object_count;
|
|
294
|
+
|
|
295
|
+
#if RGENGC_PROFILE >= 2
|
|
296
|
+
size_t generated_normal_object_count_types[RUBY_T_MASK];
|
|
297
|
+
size_t generated_shady_object_count_types[RUBY_T_MASK];
|
|
298
|
+
size_t shade_operation_count_types[RUBY_T_MASK];
|
|
299
|
+
size_t promoted_types[RUBY_T_MASK];
|
|
300
|
+
size_t remembered_normal_object_count_types[RUBY_T_MASK];
|
|
301
|
+
size_t remembered_shady_object_count_types[RUBY_T_MASK];
|
|
302
|
+
#endif
|
|
303
|
+
#endif /* RGENGC_PROFILE */
|
|
304
|
+
|
|
305
|
+
/* temporary profiling space */
|
|
306
|
+
double gc_sweep_start_time;
|
|
307
|
+
size_t total_allocated_objects_at_gc_start;
|
|
308
|
+
size_t heap_used_at_gc_start;
|
|
309
|
+
|
|
310
|
+
/* basic statistics */
|
|
311
|
+
size_t count;
|
|
312
|
+
size_t total_freed_objects;
|
|
313
|
+
size_t total_allocated_pages;
|
|
314
|
+
size_t total_freed_pages;
|
|
315
|
+
} profile;
|
|
316
|
+
struct gc_list *global_list;
|
|
317
|
+
|
|
318
|
+
VALUE gc_stress_mode;
|
|
319
|
+
|
|
320
|
+
struct {
|
|
321
|
+
VALUE parent_object;
|
|
322
|
+
int need_major_gc;
|
|
323
|
+
size_t last_major_gc;
|
|
324
|
+
size_t uncollectible_wb_unprotected_objects;
|
|
325
|
+
size_t uncollectible_wb_unprotected_objects_limit;
|
|
326
|
+
size_t old_objects;
|
|
327
|
+
size_t old_objects_limit;
|
|
328
|
+
|
|
329
|
+
#if RGENGC_ESTIMATE_OLDMALLOC
|
|
330
|
+
size_t oldmalloc_increase;
|
|
331
|
+
size_t oldmalloc_increase_limit;
|
|
332
|
+
#endif
|
|
333
|
+
|
|
334
|
+
#if RGENGC_CHECK_MODE >= 2
|
|
335
|
+
struct st_table *allrefs_table;
|
|
336
|
+
size_t error_count;
|
|
337
|
+
#endif
|
|
338
|
+
} rgengc;
|
|
339
|
+
|
|
340
|
+
struct {
|
|
341
|
+
size_t considered_count_table[T_MASK];
|
|
342
|
+
size_t moved_count_table[T_MASK];
|
|
343
|
+
size_t total_moved;
|
|
344
|
+
} rcompactor;
|
|
345
|
+
|
|
346
|
+
#if GC_ENABLE_INCREMENTAL_MARK
|
|
347
|
+
struct {
|
|
348
|
+
size_t pooled_slots;
|
|
349
|
+
size_t step_slots;
|
|
350
|
+
} rincgc;
|
|
351
|
+
#endif
|
|
352
|
+
|
|
353
|
+
st_table *id_to_obj_tbl;
|
|
354
|
+
st_table *obj_to_id_tbl;
|
|
355
|
+
|
|
356
|
+
#if GC_DEBUG_STRESS_TO_CLASS
|
|
357
|
+
VALUE stress_to_class;
|
|
358
|
+
#endif
|
|
359
|
+
} rb_objspace_t;
|
|
360
|
+
|
|
361
|
+
#endif
|