grpc 1.73.0 → 1.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +38 -17
- data/include/grpc/create_channel_from_endpoint.h +54 -0
- data/include/grpc/credentials.h +11 -5
- data/include/grpc/event_engine/event_engine.h +74 -17
- data/include/grpc/grpc_posix.h +20 -1
- data/include/grpc/impl/channel_arg_names.h +2 -4
- data/include/grpc/module.modulemap +1 -0
- data/include/grpc/support/json.h +24 -0
- data/src/core/call/interception_chain.h +7 -11
- data/src/core/channelz/channel_trace.cc +213 -115
- data/src/core/channelz/channel_trace.h +380 -86
- data/src/core/channelz/channelz.cc +270 -181
- data/src/core/channelz/channelz.h +168 -55
- data/src/core/channelz/channelz_registry.cc +2 -1
- data/src/core/channelz/channelz_registry.h +24 -0
- data/src/core/channelz/property_list.cc +357 -0
- data/src/core/channelz/property_list.h +202 -0
- data/src/core/channelz/ztrace_collector.h +3 -2
- data/src/core/client_channel/backup_poller.cc +17 -2
- data/src/core/client_channel/client_channel.cc +17 -28
- data/src/core/client_channel/client_channel_filter.cc +19 -29
- data/src/core/client_channel/config_selector.h +8 -2
- data/src/core/client_channel/dynamic_filters.cc +5 -6
- data/src/core/client_channel/dynamic_filters.h +1 -1
- data/src/core/client_channel/global_subchannel_pool.cc +4 -1
- data/src/core/client_channel/retry_filter.cc +21 -27
- data/src/core/client_channel/retry_filter.h +10 -7
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
- data/src/core/client_channel/retry_filter_legacy_call_data.h +1 -1
- data/src/core/client_channel/retry_interceptor.cc +30 -44
- data/src/core/client_channel/retry_interceptor.h +18 -17
- data/src/core/client_channel/retry_throttle.cc +46 -61
- data/src/core/client_channel/retry_throttle.h +17 -39
- data/src/core/client_channel/subchannel.cc +43 -19
- data/src/core/client_channel/subchannel.h +8 -0
- data/src/core/config/config_vars.cc +2 -0
- data/src/core/config/core_configuration.cc +1 -0
- data/src/core/config/core_configuration.h +11 -0
- data/src/core/credentials/call/call_creds_registry.h +125 -0
- data/src/core/credentials/call/call_creds_registry_init.cc +91 -0
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +6 -48
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +86 -0
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.h +74 -0
- data/src/core/credentials/call/jwt_util.cc +70 -0
- data/src/core/credentials/call/jwt_util.h +32 -0
- data/src/core/credentials/transport/channel_creds_registry_init.cc +1 -1
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +72 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +0 -1
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +1 -0
- data/src/core/credentials/transport/xds/xds_credentials.cc +0 -3
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +8 -8
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +16 -16
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -4
- data/src/core/ext/filters/http/message_compress/compression_filter.h +25 -22
- data/src/core/ext/filters/http/server/http_server_filter.h +12 -11
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +120 -35
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +162 -115
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +0 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +1239 -3514
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +1008 -1486
- data/src/core/ext/transport/chttp2/transport/flow_control.h +22 -17
- data/src/core/ext/transport/chttp2/transport/frame.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +299 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +11 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +12 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +1017 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +593 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -22
- data/{third_party/abseil-cpp/absl/strings/cord_buffer.cc → src/core/ext/transport/chttp2/transport/http2_stats_collector.cc} +14 -14
- data/src/core/ext/transport/chttp2/transport/http2_stats_collector.h +33 -0
- data/src/core/ext/transport/chttp2/transport/http2_status.h +6 -1
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +43 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +65 -0
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +0 -29
- data/src/core/ext/transport/chttp2/transport/internal.h +18 -8
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +105 -0
- data/src/core/ext/transport/chttp2/transport/keepalive.h +138 -0
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +185 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +19 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +151 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +180 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +5 -9
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +11 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +39 -1
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +19 -0
- data/src/core/ext/transport/chttp2/transport/transport_common.h +27 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +37 -11
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +571 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +120 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +1272 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +312 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +50 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +984 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +226 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +44 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +175 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +82 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +135 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +67 -0
- data/src/core/filter/auth/auth_filters.h +0 -25
- data/src/core/filter/auth/client_auth_filter.cc +0 -118
- data/src/core/filter/filter_args.h +9 -23
- data/src/core/handshaker/handshaker.cc +23 -14
- data/src/core/handshaker/handshaker.h +3 -0
- data/src/core/handshaker/http_connect/http_connect_handshaker.cc +3 -1
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +6 -5
- data/src/core/handshaker/security/secure_endpoint.cc +70 -25
- data/src/core/handshaker/security/security_handshaker.cc +4 -1
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +7 -1
- data/src/core/lib/channel/channel_args.cc +15 -0
- data/src/core/lib/channel/channel_args.h +3 -0
- data/src/core/lib/channel/channel_stack.cc +22 -23
- data/src/core/lib/channel/channel_stack.h +9 -7
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +2 -7
- data/src/core/lib/channel/promise_based_filter.h +5 -5
- data/src/core/lib/debug/trace_impl.h +0 -1
- data/src/core/lib/event_engine/ares_resolver.cc +165 -46
- data/src/core/lib/event_engine/ares_resolver.h +48 -2
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -4
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +2 -6
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.cc +40 -0
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.h +60 -0
- data/src/core/lib/event_engine/event_engine.cc +7 -0
- data/src/core/lib/event_engine/extensions/channelz.h +10 -6
- data/src/core/lib/event_engine/grpc_polled_fd.h +5 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +130 -162
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +11 -15
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +75 -117
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -9
- data/src/core/lib/event_engine/posix_engine/event_poller.h +18 -15
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +0 -18
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +124 -0
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.h +243 -0
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +29 -19
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +6 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +145 -92
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -19
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +333 -116
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +61 -18
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +45 -37
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +6 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +32 -142
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -5
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +211 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +1083 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +281 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.cc +154 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +174 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -719
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -170
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +33 -22
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +13 -11
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +117 -151
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +26 -94
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +26 -25
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +36 -62
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +7 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +12 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -1
- data/src/core/lib/event_engine/shim.cc +9 -0
- data/src/core/lib/event_engine/shim.h +3 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool.h +7 -3
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +0 -17
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +4 -2
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -2
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +4 -0
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +2 -6
- data/src/core/lib/event_engine/windows/windows_engine.cc +0 -1
- data/src/core/lib/event_engine/windows/windows_engine.h +1 -3
- data/src/core/lib/event_engine/windows/windows_listener.cc +14 -2
- data/src/core/lib/experiments/experiments.cc +45 -93
- data/src/core/lib/experiments/experiments.h +21 -51
- data/src/core/lib/iomgr/endpoint.cc +4 -3
- data/src/core/lib/iomgr/endpoint.h +7 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +7 -2
- data/src/core/lib/iomgr/ev_poll_posix.cc +7 -2
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +4 -6
- data/src/core/lib/iomgr/tcp_posix.cc +12 -6
- data/src/core/lib/iomgr/tcp_windows.cc +3 -2
- data/src/core/lib/promise/activity.h +1 -0
- data/src/core/lib/promise/arena_promise.h +23 -7
- data/src/core/lib/promise/detail/promise_factory.h +10 -0
- data/src/core/lib/promise/detail/promise_like.h +118 -11
- data/src/core/lib/promise/detail/promise_variant.h +50 -0
- data/src/core/lib/promise/detail/seq_state.h +687 -548
- data/src/core/lib/promise/if.h +20 -0
- data/src/core/lib/promise/inter_activity_latch.h +147 -0
- data/src/core/lib/promise/inter_activity_mutex.h +547 -0
- data/src/core/lib/promise/loop.h +65 -3
- data/src/core/lib/promise/map.h +24 -0
- data/src/core/lib/promise/match_promise.h +103 -0
- data/src/core/lib/promise/mpsc.cc +425 -0
- data/src/core/lib/promise/mpsc.h +490 -0
- data/src/core/lib/promise/party.cc +50 -1
- data/src/core/lib/promise/party.h +66 -1
- data/src/core/lib/promise/race.h +31 -0
- data/src/core/lib/promise/seq.h +4 -1
- data/src/core/lib/promise/status_flag.h +7 -0
- data/src/core/lib/promise/try_seq.h +4 -1
- data/src/core/lib/promise/wait_set.cc +28 -0
- data/src/core/lib/promise/wait_set.h +86 -0
- data/src/core/lib/resource_quota/arena.h +19 -0
- data/src/core/lib/slice/slice.h +5 -0
- data/src/core/lib/surface/channel_create.cc +88 -13
- data/src/core/lib/surface/channel_create.h +4 -0
- data/src/core/lib/surface/channel_init.cc +164 -47
- data/src/core/lib/surface/channel_init.h +64 -1
- data/src/core/lib/surface/filter_stack_call.cc +18 -9
- data/src/core/lib/surface/init.cc +6 -15
- data/src/core/lib/surface/legacy_channel.cc +3 -5
- data/src/core/lib/surface/legacy_channel.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +110 -0
- data/src/core/lib/transport/promise_endpoint.h +307 -0
- data/src/core/load_balancing/child_policy_handler.cc +2 -4
- data/src/core/load_balancing/delegating_helper.h +2 -3
- data/src/core/load_balancing/health_check_client.cc +1 -5
- data/src/core/load_balancing/lb_policy.h +1 -3
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +3 -0
- data/src/core/load_balancing/xds/cds.cc +10 -1
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
- data/src/core/resolver/xds/xds_config.cc +6 -3
- data/src/core/resolver/xds/xds_config.h +9 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +21 -6
- data/src/core/resolver/xds/xds_dependency_manager.h +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +31 -11
- data/src/core/server/server.cc +83 -12
- data/src/core/server/server.h +21 -2
- data/src/core/server/xds_server_config_fetcher.cc +63 -25
- data/src/core/service_config/service_config.h +1 -1
- data/src/core/service_config/service_config_impl.h +1 -1
- data/src/core/telemetry/context_list_entry.cc +38 -0
- data/src/core/telemetry/context_list_entry.h +42 -12
- data/src/core/telemetry/stats_data.cc +233 -207
- data/src/core/telemetry/stats_data.h +250 -153
- data/src/core/telemetry/tcp_tracer.h +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +11 -3
- data/src/core/tsi/fake_transport_security.cc +17 -0
- data/src/core/tsi/ssl_transport_security.cc +2 -0
- data/src/core/tsi/transport_security_grpc.cc +8 -0
- data/src/core/tsi/transport_security_grpc.h +15 -0
- data/src/core/util/backoff.cc +1 -5
- data/src/core/util/backoff.h +1 -0
- data/src/core/util/down_cast.h +1 -1
- data/src/core/util/function_signature.h +15 -1
- data/src/core/util/http_client/httpcli.cc +12 -5
- data/src/core/util/http_client/httpcli.h +4 -1
- data/src/core/util/latent_see.h +8 -5
- data/src/core/util/log.cc +4 -0
- data/src/core/util/memory_usage.h +268 -0
- data/src/core/util/per_cpu.cc +2 -0
- data/src/core/util/per_cpu.h +7 -0
- data/src/core/util/shared_bit_gen.h +20 -0
- data/src/core/util/single_set_ptr.h +2 -2
- data/src/core/util/upb_utils.h +42 -0
- data/src/core/util/uri.cc +3 -2
- data/src/core/util/useful.h +53 -2
- data/src/core/util/wait_for_single_owner.cc +31 -0
- data/src/core/util/wait_for_single_owner.h +24 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +5 -0
- data/src/core/xds/grpc/xds_client_grpc.cc +6 -2
- data/src/core/xds/grpc/xds_common_types_parser.cc +138 -50
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_filter.h +7 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +22 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -0
- data/src/core/xds/grpc/xds_route_config_parser.cc +15 -38
- data/src/core/xds/grpc/xds_server_grpc.cc +63 -13
- data/src/core/xds/grpc/xds_server_grpc.h +10 -2
- data/src/core/xds/grpc/xds_server_grpc_interface.h +4 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +18 -0
- data/src/core/xds/xds_client/xds_bootstrap.h +2 -0
- data/src/core/xds/xds_client/xds_client.cc +26 -5
- data/src/ruby/ext/grpc/extconf.rb +2 -0
- data/src/ruby/ext/grpc/rb_call.c +1 -8
- data/src/ruby/ext/grpc/rb_channel.c +72 -568
- data/src/ruby/ext/grpc/rb_channel.h +0 -3
- data/src/ruby/ext/grpc/rb_completion_queue.c +26 -14
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -7
- data/src/ruby/ext/grpc/rb_grpc.c +9 -5
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/ext/grpc/rb_loader.c +0 -4
- data/src/ruby/ext/grpc/rb_server.c +31 -50
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/core_spec.rb +22 -0
- data/src/ruby/spec/generic/active_call_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +2 -19
- data/third_party/abseil-cpp/absl/base/attributes.h +76 -7
- data/third_party/abseil-cpp/absl/base/call_once.h +11 -12
- data/third_party/abseil-cpp/absl/base/config.h +20 -129
- data/third_party/abseil-cpp/absl/base/{internal/fast_type_id.h → fast_type_id.h} +11 -16
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +0 -5
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +7 -7
- data/third_party/abseil-cpp/absl/base/internal/endian.h +34 -38
- data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +71 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -5
- data/third_party/abseil-cpp/absl/base/internal/{nullability_impl.h → nullability_deprecated.h} +45 -8
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +0 -9
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -13
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +6 -6
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +8 -3
- data/third_party/abseil-cpp/absl/base/no_destructor.h +11 -32
- data/third_party/abseil-cpp/absl/base/nullability.h +84 -72
- data/third_party/abseil-cpp/absl/base/options.h +3 -80
- data/third_party/abseil-cpp/absl/base/policy_checks.h +7 -7
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +1 -3
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -4
- data/third_party/abseil-cpp/absl/container/btree_map.h +4 -2
- data/third_party/abseil-cpp/absl/container/btree_set.h +4 -2
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -14
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -1
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +8 -5
- data/third_party/abseil-cpp/absl/container/internal/btree.h +132 -29
- data/third_party/abseil-cpp/absl/container/internal/btree_container.h +175 -71
- data/third_party/abseil-cpp/absl/container/internal/common.h +43 -0
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -2
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +9 -10
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +1 -8
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +0 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +20 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +31 -12
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +2 -7
- data/third_party/abseil-cpp/absl/container/internal/layout.h +26 -42
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +199 -68
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +1354 -183
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +881 -1424
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +80 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +0 -4
- data/third_party/abseil-cpp/absl/crc/crc32c.h +7 -5
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +0 -22
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +45 -74
- data/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +5 -5
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +8 -35
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +16 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +40 -37
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +16 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +14 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +10 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +27 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +13 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +4 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +15 -28
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +144 -27
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +73 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +25 -6
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/flag.h +4 -3
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +7 -6
- data/third_party/abseil-cpp/absl/flags/internal/registry.h +4 -3
- data/third_party/abseil-cpp/absl/flags/reflection.cc +2 -3
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +8 -10
- data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -9
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +110 -226
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +10 -12
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -5
- data/third_party/abseil-cpp/absl/hash/hash.h +18 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -5
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -61
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +25 -68
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +2 -6
- data/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
- data/third_party/abseil-cpp/absl/log/check.h +2 -1
- data/third_party/abseil-cpp/absl/log/globals.h +4 -5
- data/third_party/abseil-cpp/absl/log/internal/append_truncated.h +28 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +22 -22
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +65 -62
- data/third_party/abseil-cpp/absl/log/internal/conditions.cc +5 -3
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +7 -2
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +85 -43
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +84 -59
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -0
- data/third_party/abseil-cpp/absl/log/internal/proto.cc +3 -2
- data/third_party/abseil-cpp/absl/log/internal/proto.h +3 -3
- data/third_party/abseil-cpp/absl/log/internal/strip.h +4 -12
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +8 -6
- data/third_party/abseil-cpp/absl/log/internal/voidify.h +10 -4
- data/third_party/abseil-cpp/absl/log/log.h +48 -35
- data/third_party/abseil-cpp/absl/log/log_sink_registry.h +2 -2
- data/third_party/abseil-cpp/absl/meta/type_traits.h +46 -175
- data/third_party/abseil-cpp/absl/numeric/bits.h +68 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -52
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +7 -3
- data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +1 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +10 -11
- data/third_party/abseil-cpp/absl/random/distributions.h +6 -8
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/{pool_urbg.cc → entropy_pool.cc} +22 -90
- data/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +1 -1
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +20 -12
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +5 -5
- data/third_party/abseil-cpp/absl/random/random.h +88 -53
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +6 -2
- data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +3 -4
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +3 -4
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -3
- data/third_party/abseil-cpp/absl/status/status.cc +4 -8
- data/third_party/abseil-cpp/absl/status/status.h +8 -8
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.cc +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +6 -6
- data/third_party/abseil-cpp/absl/strings/ascii.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/ascii.h +18 -18
- data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -22
- data/third_party/abseil-cpp/absl/strings/charconv.h +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +54 -58
- data/third_party/abseil-cpp/absl/strings/cord.h +94 -83
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +11 -11
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +3 -3
- data/third_party/abseil-cpp/absl/strings/escaping.cc +130 -149
- data/third_party/abseil-cpp/absl/strings/escaping.h +9 -10
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +6 -8
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +7 -63
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +0 -22
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +5 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +0 -5
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +96 -1
- data/third_party/abseil-cpp/absl/strings/internal/utf8.h +15 -1
- data/third_party/abseil-cpp/absl/strings/numbers.cc +53 -32
- data/third_party/abseil-cpp/absl/strings/numbers.h +87 -58
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +6 -7
- data/third_party/abseil-cpp/absl/strings/str_cat.h +32 -32
- data/third_party/abseil-cpp/absl/strings/str_format.h +18 -18
- data/third_party/abseil-cpp/absl/strings/str_replace.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/str_replace.h +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.cc +4 -9
- data/third_party/abseil-cpp/absl/strings/string_view.h +27 -32
- data/third_party/abseil-cpp/absl/strings/strip.h +4 -4
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -4
- data/third_party/abseil-cpp/absl/strings/substitute.h +66 -64
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +0 -5
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +97 -69
- data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +12 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +90 -111
- data/third_party/abseil-cpp/absl/time/time.h +20 -15
- data/third_party/abseil-cpp/absl/types/optional.h +7 -747
- data/third_party/abseil-cpp/absl/types/span.h +13 -11
- data/third_party/abseil-cpp/absl/types/variant.h +5 -784
- data/third_party/abseil-cpp/absl/utility/utility.h +10 -185
- metadata +72 -20
- data/src/core/lib/event_engine/forkable.cc +0 -105
- data/src/core/lib/event_engine/forkable.h +0 -67
- data/src/core/lib/iomgr/python_util.h +0 -46
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +0 -108
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +0 -241
- data/third_party/abseil-cpp/absl/log/log_entry.cc +0 -41
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +0 -131
- data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +0 -66
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +0 -78
- data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +0 -82
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +0 -82
- data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -352
- data/third_party/abseil-cpp/absl/types/internal/variant.h +0 -1622
@@ -79,6 +79,7 @@
|
|
79
79
|
#include "absl/base/optimization.h"
|
80
80
|
#include "absl/crc/internal/crc_cord_state.h"
|
81
81
|
#include "absl/functional/function_ref.h"
|
82
|
+
#include "absl/hash/internal/weakly_mixed_integer.h"
|
82
83
|
#include "absl/meta/type_traits.h"
|
83
84
|
#include "absl/strings/cord_analysis.h"
|
84
85
|
#include "absl/strings/cord_buffer.h"
|
@@ -102,8 +103,8 @@ class Cord;
|
|
102
103
|
class CordTestPeer;
|
103
104
|
template <typename Releaser>
|
104
105
|
Cord MakeCordFromExternal(absl::string_view, Releaser&&);
|
105
|
-
void CopyCordToString(const Cord& src,
|
106
|
-
void AppendCordToString(const Cord& src,
|
106
|
+
void CopyCordToString(const Cord& src, std::string* absl_nonnull dst);
|
107
|
+
void AppendCordToString(const Cord& src, std::string* absl_nonnull dst);
|
107
108
|
|
108
109
|
// Cord memory accounting modes
|
109
110
|
enum class CordMemoryAccounting {
|
@@ -417,8 +418,7 @@ class Cord {
|
|
417
418
|
// guarantee that pointers previously returned by `dst->data()` remain valid
|
418
419
|
// even if `*dst` had enough capacity to hold `src`. If `*dst` is a new
|
419
420
|
// object, prefer to simply use the conversion operator to `std::string`.
|
420
|
-
friend void CopyCordToString(const Cord& src,
|
421
|
-
absl::Nonnull<std::string*> dst);
|
421
|
+
friend void CopyCordToString(const Cord& src, std::string* absl_nonnull dst);
|
422
422
|
|
423
423
|
// AppendCordToString()
|
424
424
|
//
|
@@ -430,7 +430,7 @@ class Cord {
|
|
430
430
|
// `dst->data()`. If `*dst` is a new object, prefer to simply use the
|
431
431
|
// conversion operator to `std::string`.
|
432
432
|
friend void AppendCordToString(const Cord& src,
|
433
|
-
|
433
|
+
std::string* absl_nonnull dst);
|
434
434
|
|
435
435
|
class CharIterator;
|
436
436
|
|
@@ -467,7 +467,7 @@ class Cord {
|
|
467
467
|
using iterator_category = std::input_iterator_tag;
|
468
468
|
using value_type = absl::string_view;
|
469
469
|
using difference_type = ptrdiff_t;
|
470
|
-
using pointer =
|
470
|
+
using pointer = const value_type* absl_nonnull;
|
471
471
|
using reference = value_type;
|
472
472
|
|
473
473
|
ChunkIterator() = default;
|
@@ -488,13 +488,13 @@ class Cord {
|
|
488
488
|
using CordRepBtreeReader = absl::cord_internal::CordRepBtreeReader;
|
489
489
|
|
490
490
|
// Constructs a `begin()` iterator from `tree`.
|
491
|
-
explicit ChunkIterator(
|
491
|
+
explicit ChunkIterator(cord_internal::CordRep* absl_nonnull tree);
|
492
492
|
|
493
493
|
// Constructs a `begin()` iterator from `cord`.
|
494
|
-
explicit ChunkIterator(
|
494
|
+
explicit ChunkIterator(const Cord* absl_nonnull cord);
|
495
495
|
|
496
496
|
// Initializes this instance from a tree. Invoked by constructors.
|
497
|
-
void InitTree(
|
497
|
+
void InitTree(cord_internal::CordRep* absl_nonnull tree);
|
498
498
|
|
499
499
|
// Removes `n` bytes from `current_chunk_`. Expects `n` to be smaller than
|
500
500
|
// `current_chunk_.size()`.
|
@@ -512,7 +512,7 @@ class Cord {
|
|
512
512
|
// The current leaf, or `nullptr` if the iterator points to short data.
|
513
513
|
// If the current chunk is a substring node, current_leaf_ points to the
|
514
514
|
// underlying flat or external node.
|
515
|
-
absl::
|
515
|
+
absl::cord_internal::CordRep* absl_nullable current_leaf_ = nullptr;
|
516
516
|
// The number of bytes left in the `Cord` over which we are iterating.
|
517
517
|
size_t bytes_remaining_ = 0;
|
518
518
|
|
@@ -569,13 +569,13 @@ class Cord {
|
|
569
569
|
using iterator = ChunkIterator;
|
570
570
|
using const_iterator = ChunkIterator;
|
571
571
|
|
572
|
-
explicit ChunkRange(
|
572
|
+
explicit ChunkRange(const Cord* absl_nonnull cord) : cord_(cord) {}
|
573
573
|
|
574
574
|
ChunkIterator begin() const;
|
575
575
|
ChunkIterator end() const;
|
576
576
|
|
577
577
|
private:
|
578
|
-
|
578
|
+
const Cord* absl_nonnull cord_;
|
579
579
|
};
|
580
580
|
|
581
581
|
// Cord::Chunks()
|
@@ -628,7 +628,7 @@ class Cord {
|
|
628
628
|
using iterator_category = std::input_iterator_tag;
|
629
629
|
using value_type = char;
|
630
630
|
using difference_type = ptrdiff_t;
|
631
|
-
using pointer =
|
631
|
+
using pointer = const char* absl_nonnull;
|
632
632
|
using reference = const char&;
|
633
633
|
|
634
634
|
CharIterator() = default;
|
@@ -642,7 +642,7 @@ class Cord {
|
|
642
642
|
friend Cord;
|
643
643
|
|
644
644
|
private:
|
645
|
-
explicit CharIterator(
|
645
|
+
explicit CharIterator(const Cord* absl_nonnull cord)
|
646
646
|
: chunk_iterator_(cord) {}
|
647
647
|
|
648
648
|
ChunkIterator chunk_iterator_;
|
@@ -654,14 +654,14 @@ class Cord {
|
|
654
654
|
// advanced as a separate `Cord`. `n_bytes` must be less than or equal to the
|
655
655
|
// number of bytes within the Cord; otherwise, behavior is undefined. It is
|
656
656
|
// valid to pass `char_end()` and `0`.
|
657
|
-
static Cord AdvanceAndRead(
|
657
|
+
static Cord AdvanceAndRead(CharIterator* absl_nonnull it, size_t n_bytes);
|
658
658
|
|
659
659
|
// Cord::Advance()
|
660
660
|
//
|
661
661
|
// Advances the `Cord::CharIterator` by `n_bytes`. `n_bytes` must be less than
|
662
662
|
// or equal to the number of bytes remaining within the Cord; otherwise,
|
663
663
|
// behavior is undefined. It is valid to pass `char_end()` and `0`.
|
664
|
-
static void Advance(
|
664
|
+
static void Advance(CharIterator* absl_nonnull it, size_t n_bytes);
|
665
665
|
|
666
666
|
// Cord::ChunkRemaining()
|
667
667
|
//
|
@@ -670,6 +670,13 @@ class Cord {
|
|
670
670
|
// `it` must be dereferenceable.
|
671
671
|
static absl::string_view ChunkRemaining(const CharIterator& it);
|
672
672
|
|
673
|
+
// Cord::Distance()
|
674
|
+
//
|
675
|
+
// Returns the distance between `first` and `last`, as if
|
676
|
+
// `std::distance(first, last)` was called.
|
677
|
+
static ptrdiff_t Distance(const CharIterator& first,
|
678
|
+
const CharIterator& last);
|
679
|
+
|
673
680
|
// Cord::char_begin()
|
674
681
|
//
|
675
682
|
// Returns an iterator to the first character of the `Cord`.
|
@@ -710,13 +717,13 @@ class Cord {
|
|
710
717
|
using iterator = CharIterator;
|
711
718
|
using const_iterator = CharIterator;
|
712
719
|
|
713
|
-
explicit CharRange(
|
720
|
+
explicit CharRange(const Cord* absl_nonnull cord) : cord_(cord) {}
|
714
721
|
|
715
722
|
CharIterator begin() const;
|
716
723
|
CharIterator end() const;
|
717
724
|
|
718
725
|
private:
|
719
|
-
|
726
|
+
const Cord* absl_nonnull cord_;
|
720
727
|
};
|
721
728
|
|
722
729
|
// Cord::Chars()
|
@@ -775,7 +782,7 @@ class Cord {
|
|
775
782
|
CharIterator Find(const absl::Cord& needle) const;
|
776
783
|
|
777
784
|
// Supports absl::Cord as a sink object for absl::Format().
|
778
|
-
friend void AbslFormatFlush(absl::
|
785
|
+
friend void AbslFormatFlush(absl::Cord* absl_nonnull cord,
|
779
786
|
absl::string_view part) {
|
780
787
|
cord->Append(part);
|
781
788
|
}
|
@@ -878,7 +885,7 @@ class Cord {
|
|
878
885
|
}
|
879
886
|
#endif
|
880
887
|
|
881
|
-
friend
|
888
|
+
friend const CordzInfo* absl_nullable GetCordzInfoForTesting(
|
882
889
|
const Cord& cord);
|
883
890
|
|
884
891
|
// Calls the provided function once for each cord chunk, in order. Unlike
|
@@ -907,21 +914,21 @@ class Cord {
|
|
907
914
|
InlineRep& operator=(InlineRep&& src) noexcept;
|
908
915
|
|
909
916
|
explicit constexpr InlineRep(absl::string_view sv,
|
910
|
-
|
917
|
+
CordRep* absl_nullable rep);
|
911
918
|
|
912
|
-
void Swap(
|
919
|
+
void Swap(InlineRep* absl_nonnull rhs);
|
913
920
|
size_t size() const;
|
914
921
|
// Returns nullptr if holding pointer
|
915
|
-
|
922
|
+
const char* absl_nullable data() const;
|
916
923
|
// Discards pointer, if any
|
917
|
-
void set_data(
|
918
|
-
|
924
|
+
void set_data(const char* absl_nonnull data, size_t n);
|
925
|
+
char* absl_nonnull set_data(size_t n); // Write data to the result
|
919
926
|
// Returns nullptr if holding bytes
|
920
|
-
absl::
|
921
|
-
absl::
|
922
|
-
|
927
|
+
absl::cord_internal::CordRep* absl_nullable tree() const;
|
928
|
+
absl::cord_internal::CordRep* absl_nonnull as_tree() const;
|
929
|
+
const char* absl_nonnull as_chars() const;
|
923
930
|
// Returns non-null iff was holding a pointer
|
924
|
-
absl::
|
931
|
+
absl::cord_internal::CordRep* absl_nullable clear();
|
925
932
|
// Converts to pointer if necessary.
|
926
933
|
void reduce_size(size_t n); // REQUIRES: holding data
|
927
934
|
void remove_prefix(size_t n); // REQUIRES: holding data
|
@@ -930,58 +937,56 @@ class Cord {
|
|
930
937
|
|
931
938
|
// Creates a CordRepFlat instance from the current inlined data with `extra'
|
932
939
|
// bytes of desired additional capacity.
|
933
|
-
|
940
|
+
CordRepFlat* absl_nonnull MakeFlatWithExtraCapacity(size_t extra);
|
934
941
|
|
935
942
|
// Sets the tree value for this instance. `rep` must not be null.
|
936
943
|
// Requires the current instance to hold a tree, and a lock to be held on
|
937
944
|
// any CordzInfo referenced by this instance. The latter is enforced through
|
938
945
|
// the CordzUpdateScope argument. If the current instance is sampled, then
|
939
946
|
// the CordzInfo instance is updated to reference the new `rep` value.
|
940
|
-
void SetTree(
|
947
|
+
void SetTree(CordRep* absl_nonnull rep, const CordzUpdateScope& scope);
|
941
948
|
|
942
949
|
// Identical to SetTree(), except that `rep` is allowed to be null, in
|
943
950
|
// which case the current instance is reset to an empty value.
|
944
|
-
void SetTreeOrEmpty(
|
951
|
+
void SetTreeOrEmpty(CordRep* absl_nullable rep,
|
945
952
|
const CordzUpdateScope& scope);
|
946
953
|
|
947
954
|
// Sets the tree value for this instance, and randomly samples this cord.
|
948
955
|
// This function disregards existing contents in `data_`, and should be
|
949
956
|
// called when a Cord is 'promoted' from an 'uninitialized' or 'inlined'
|
950
957
|
// value to a non-inlined (tree / ring) value.
|
951
|
-
void EmplaceTree(
|
958
|
+
void EmplaceTree(CordRep* absl_nonnull rep, MethodIdentifier method);
|
952
959
|
|
953
960
|
// Identical to EmplaceTree, except that it copies the parent stack from
|
954
961
|
// the provided `parent` data if the parent is sampled.
|
955
|
-
void EmplaceTree(
|
962
|
+
void EmplaceTree(CordRep* absl_nonnull rep, const InlineData& parent,
|
956
963
|
MethodIdentifier method);
|
957
964
|
|
958
965
|
// Commits the change of a newly created, or updated `rep` root value into
|
959
966
|
// this cord. `old_rep` indicates the old (inlined or tree) value of the
|
960
967
|
// cord, and determines if the commit invokes SetTree() or EmplaceTree().
|
961
|
-
void CommitTree(
|
962
|
-
|
968
|
+
void CommitTree(const CordRep* absl_nullable old_rep,
|
969
|
+
CordRep* absl_nonnull rep, const CordzUpdateScope& scope,
|
963
970
|
MethodIdentifier method);
|
964
971
|
|
965
|
-
void AppendTreeToInlined(
|
972
|
+
void AppendTreeToInlined(CordRep* absl_nonnull tree,
|
966
973
|
MethodIdentifier method);
|
967
|
-
void AppendTreeToTree(
|
968
|
-
|
969
|
-
void
|
970
|
-
void PrependTreeToInlined(absl::Nonnull<CordRep*> tree,
|
974
|
+
void AppendTreeToTree(CordRep* absl_nonnull tree, MethodIdentifier method);
|
975
|
+
void AppendTree(CordRep* absl_nonnull tree, MethodIdentifier method);
|
976
|
+
void PrependTreeToInlined(CordRep* absl_nonnull tree,
|
971
977
|
MethodIdentifier method);
|
972
|
-
void PrependTreeToTree(
|
973
|
-
|
974
|
-
void PrependTree(absl::Nonnull<CordRep*> tree, MethodIdentifier method);
|
978
|
+
void PrependTreeToTree(CordRep* absl_nonnull tree, MethodIdentifier method);
|
979
|
+
void PrependTree(CordRep* absl_nonnull tree, MethodIdentifier method);
|
975
980
|
|
976
981
|
bool IsSame(const InlineRep& other) const { return data_ == other.data_; }
|
977
982
|
|
978
983
|
// Copies the inline contents into `dst`. Assumes the cord is not empty.
|
979
|
-
void CopyTo(
|
984
|
+
void CopyTo(std::string* absl_nonnull dst) const {
|
980
985
|
data_.CopyInlineToString(dst);
|
981
986
|
}
|
982
987
|
|
983
988
|
// Copies the inline contents into `dst`. Assumes the cord is not empty.
|
984
|
-
void CopyToArray(
|
989
|
+
void CopyToArray(char* absl_nonnull dst) const;
|
985
990
|
|
986
991
|
bool is_tree() const { return data_.is_tree(); }
|
987
992
|
|
@@ -994,12 +999,12 @@ class Cord {
|
|
994
999
|
}
|
995
1000
|
|
996
1001
|
// Returns the profiled CordzInfo, or nullptr if not sampled.
|
997
|
-
absl::
|
1002
|
+
absl::cord_internal::CordzInfo* absl_nullable cordz_info() const {
|
998
1003
|
return data_.cordz_info();
|
999
1004
|
}
|
1000
1005
|
|
1001
1006
|
// Sets the profiled CordzInfo.
|
1002
|
-
void set_cordz_info(
|
1007
|
+
void set_cordz_info(cord_internal::CordzInfo* absl_nonnull cordz_info) {
|
1003
1008
|
assert(cordz_info != nullptr);
|
1004
1009
|
data_.set_cordz_info(cordz_info);
|
1005
1010
|
}
|
@@ -1031,19 +1036,19 @@ class Cord {
|
|
1031
1036
|
InlineRep contents_;
|
1032
1037
|
|
1033
1038
|
// Helper for GetFlat() and TryFlat().
|
1034
|
-
static bool GetFlatAux(absl::
|
1035
|
-
absl::
|
1039
|
+
static bool GetFlatAux(absl::cord_internal::CordRep* absl_nonnull rep,
|
1040
|
+
absl::string_view* absl_nonnull fragment);
|
1036
1041
|
|
1037
1042
|
// Helper for ForEachChunk().
|
1038
1043
|
static void ForEachChunkAux(
|
1039
|
-
absl::
|
1044
|
+
absl::cord_internal::CordRep* absl_nonnull rep,
|
1040
1045
|
absl::FunctionRef<void(absl::string_view)> callback);
|
1041
1046
|
|
1042
1047
|
// The destructor for non-empty Cords.
|
1043
1048
|
void DestroyCordSlow();
|
1044
1049
|
|
1045
1050
|
// Out-of-line implementation of slower parts of logic.
|
1046
|
-
void CopyToArraySlowPath(
|
1051
|
+
void CopyToArraySlowPath(char* absl_nonnull dst) const;
|
1047
1052
|
int CompareSlowPath(absl::string_view rhs, size_t compared_size,
|
1048
1053
|
size_t size_to_compare) const;
|
1049
1054
|
int CompareSlowPath(const Cord& rhs, size_t compared_size,
|
@@ -1060,8 +1065,8 @@ class Cord {
|
|
1060
1065
|
|
1061
1066
|
// Returns a new reference to contents_.tree(), or steals an existing
|
1062
1067
|
// reference if called on an rvalue.
|
1063
|
-
absl::
|
1064
|
-
absl::
|
1068
|
+
absl::cord_internal::CordRep* absl_nonnull TakeRep() const&;
|
1069
|
+
absl::cord_internal::CordRep* absl_nonnull TakeRep() &&;
|
1065
1070
|
|
1066
1071
|
// Helper for Append().
|
1067
1072
|
template <typename C>
|
@@ -1093,17 +1098,17 @@ class Cord {
|
|
1093
1098
|
hash_state = combiner.add_buffer(std::move(hash_state), chunk.data(),
|
1094
1099
|
chunk.size());
|
1095
1100
|
});
|
1096
|
-
return H::combine(combiner.finalize(std::move(hash_state)),
|
1101
|
+
return H::combine(combiner.finalize(std::move(hash_state)),
|
1102
|
+
hash_internal::WeaklyMixedInteger{size()});
|
1097
1103
|
}
|
1098
1104
|
|
1099
1105
|
friend class CrcCord;
|
1100
1106
|
void SetCrcCordState(crc_internal::CrcCordState state);
|
1101
|
-
|
1102
|
-
const;
|
1107
|
+
const crc_internal::CrcCordState* absl_nullable MaybeGetCrcCordState() const;
|
1103
1108
|
|
1104
1109
|
CharIterator FindImpl(CharIterator it, absl::string_view needle) const;
|
1105
1110
|
|
1106
|
-
void CopyToArrayImpl(
|
1111
|
+
void CopyToArrayImpl(char* absl_nonnull dst) const;
|
1107
1112
|
};
|
1108
1113
|
|
1109
1114
|
ABSL_NAMESPACE_END
|
@@ -1123,14 +1128,14 @@ namespace cord_internal {
|
|
1123
1128
|
// Does non-template-specific `CordRepExternal` initialization.
|
1124
1129
|
// Requires `data` to be non-empty.
|
1125
1130
|
void InitializeCordRepExternal(absl::string_view data,
|
1126
|
-
|
1131
|
+
CordRepExternal* absl_nonnull rep);
|
1127
1132
|
|
1128
1133
|
// Creates a new `CordRep` that owns `data` and `releaser` and returns a pointer
|
1129
1134
|
// to it. Requires `data` to be non-empty.
|
1130
1135
|
template <typename Releaser>
|
1131
1136
|
// NOLINTNEXTLINE - suppress clang-tidy raw pointer return.
|
1132
|
-
|
1133
|
-
|
1137
|
+
CordRep* absl_nonnull NewExternalRep(absl::string_view data,
|
1138
|
+
Releaser&& releaser) {
|
1134
1139
|
assert(!data.empty());
|
1135
1140
|
using ReleaserType = absl::decay_t<Releaser>;
|
1136
1141
|
CordRepExternal* rep = new CordRepExternalImpl<ReleaserType>(
|
@@ -1142,7 +1147,7 @@ absl::Nonnull<CordRep*> NewExternalRep(absl::string_view data,
|
|
1142
1147
|
// Overload for function reference types that dispatches using a function
|
1143
1148
|
// pointer because there are no `alignof()` or `sizeof()` a function reference.
|
1144
1149
|
// NOLINTNEXTLINE - suppress clang-tidy raw pointer return.
|
1145
|
-
inline
|
1150
|
+
inline CordRep* absl_nonnull NewExternalRep(
|
1146
1151
|
absl::string_view data, void (&releaser)(absl::string_view)) {
|
1147
1152
|
return NewExternalRep(data, &releaser);
|
1148
1153
|
}
|
@@ -1166,7 +1171,7 @@ Cord MakeCordFromExternal(absl::string_view data, Releaser&& releaser) {
|
|
1166
1171
|
}
|
1167
1172
|
|
1168
1173
|
constexpr Cord::InlineRep::InlineRep(absl::string_view sv,
|
1169
|
-
|
1174
|
+
CordRep* absl_nullable rep)
|
1170
1175
|
: data_(sv, rep) {}
|
1171
1176
|
|
1172
1177
|
inline Cord::InlineRep::InlineRep(const Cord::InlineRep& src)
|
@@ -1205,7 +1210,7 @@ inline Cord::InlineRep& Cord::InlineRep::operator=(
|
|
1205
1210
|
return *this;
|
1206
1211
|
}
|
1207
1212
|
|
1208
|
-
inline void Cord::InlineRep::Swap(
|
1213
|
+
inline void Cord::InlineRep::Swap(Cord::InlineRep* absl_nonnull rhs) {
|
1209
1214
|
if (rhs == this) {
|
1210
1215
|
return;
|
1211
1216
|
}
|
@@ -1213,22 +1218,22 @@ inline void Cord::InlineRep::Swap(absl::Nonnull<Cord::InlineRep*> rhs) {
|
|
1213
1218
|
swap(data_, rhs->data_);
|
1214
1219
|
}
|
1215
1220
|
|
1216
|
-
inline
|
1221
|
+
inline const char* absl_nullable Cord::InlineRep::data() const {
|
1217
1222
|
return is_tree() ? nullptr : data_.as_chars();
|
1218
1223
|
}
|
1219
1224
|
|
1220
|
-
inline
|
1225
|
+
inline const char* absl_nonnull Cord::InlineRep::as_chars() const {
|
1221
1226
|
assert(!data_.is_tree());
|
1222
1227
|
return data_.as_chars();
|
1223
1228
|
}
|
1224
1229
|
|
1225
|
-
inline absl::
|
1230
|
+
inline absl::cord_internal::CordRep* absl_nonnull Cord::InlineRep::as_tree()
|
1226
1231
|
const {
|
1227
1232
|
assert(data_.is_tree());
|
1228
1233
|
return data_.as_tree();
|
1229
1234
|
}
|
1230
1235
|
|
1231
|
-
inline absl::
|
1236
|
+
inline absl::cord_internal::CordRep* absl_nullable Cord::InlineRep::tree()
|
1232
1237
|
const {
|
1233
1238
|
if (is_tree()) {
|
1234
1239
|
return as_tree();
|
@@ -1241,7 +1246,7 @@ inline size_t Cord::InlineRep::size() const {
|
|
1241
1246
|
return is_tree() ? as_tree()->length : inline_size();
|
1242
1247
|
}
|
1243
1248
|
|
1244
|
-
inline
|
1249
|
+
inline cord_internal::CordRepFlat* absl_nonnull
|
1245
1250
|
Cord::InlineRep::MakeFlatWithExtraCapacity(size_t extra) {
|
1246
1251
|
static_assert(cord_internal::kMinFlatLength >= sizeof(data_), "");
|
1247
1252
|
size_t len = data_.inline_size();
|
@@ -1251,21 +1256,21 @@ Cord::InlineRep::MakeFlatWithExtraCapacity(size_t extra) {
|
|
1251
1256
|
return result;
|
1252
1257
|
}
|
1253
1258
|
|
1254
|
-
inline void Cord::InlineRep::EmplaceTree(
|
1259
|
+
inline void Cord::InlineRep::EmplaceTree(CordRep* absl_nonnull rep,
|
1255
1260
|
MethodIdentifier method) {
|
1256
1261
|
assert(rep);
|
1257
1262
|
data_.make_tree(rep);
|
1258
1263
|
CordzInfo::MaybeTrackCord(data_, method);
|
1259
1264
|
}
|
1260
1265
|
|
1261
|
-
inline void Cord::InlineRep::EmplaceTree(
|
1266
|
+
inline void Cord::InlineRep::EmplaceTree(CordRep* absl_nonnull rep,
|
1262
1267
|
const InlineData& parent,
|
1263
1268
|
MethodIdentifier method) {
|
1264
1269
|
data_.make_tree(rep);
|
1265
1270
|
CordzInfo::MaybeTrackCord(data_, parent, method);
|
1266
1271
|
}
|
1267
1272
|
|
1268
|
-
inline void Cord::InlineRep::SetTree(
|
1273
|
+
inline void Cord::InlineRep::SetTree(CordRep* absl_nonnull rep,
|
1269
1274
|
const CordzUpdateScope& scope) {
|
1270
1275
|
assert(rep);
|
1271
1276
|
assert(data_.is_tree());
|
@@ -1273,7 +1278,7 @@ inline void Cord::InlineRep::SetTree(absl::Nonnull<CordRep*> rep,
|
|
1273
1278
|
scope.SetCordRep(rep);
|
1274
1279
|
}
|
1275
1280
|
|
1276
|
-
inline void Cord::InlineRep::SetTreeOrEmpty(
|
1281
|
+
inline void Cord::InlineRep::SetTreeOrEmpty(CordRep* absl_nullable rep,
|
1277
1282
|
const CordzUpdateScope& scope) {
|
1278
1283
|
assert(data_.is_tree());
|
1279
1284
|
if (rep) {
|
@@ -1284,8 +1289,8 @@ inline void Cord::InlineRep::SetTreeOrEmpty(absl::Nullable<CordRep*> rep,
|
|
1284
1289
|
scope.SetCordRep(rep);
|
1285
1290
|
}
|
1286
1291
|
|
1287
|
-
inline void Cord::InlineRep::CommitTree(
|
1288
|
-
|
1292
|
+
inline void Cord::InlineRep::CommitTree(const CordRep* absl_nullable old_rep,
|
1293
|
+
CordRep* absl_nonnull rep,
|
1289
1294
|
const CordzUpdateScope& scope,
|
1290
1295
|
MethodIdentifier method) {
|
1291
1296
|
if (old_rep) {
|
@@ -1295,7 +1300,7 @@ inline void Cord::InlineRep::CommitTree(absl::Nullable<const CordRep*> old_rep,
|
|
1295
1300
|
}
|
1296
1301
|
}
|
1297
1302
|
|
1298
|
-
inline absl::
|
1303
|
+
inline absl::cord_internal::CordRep* absl_nullable Cord::InlineRep::clear() {
|
1299
1304
|
if (is_tree()) {
|
1300
1305
|
CordzInfo::MaybeUntrackCord(cordz_info());
|
1301
1306
|
}
|
@@ -1304,7 +1309,7 @@ inline absl::Nullable<absl::cord_internal::CordRep*> Cord::InlineRep::clear() {
|
|
1304
1309
|
return result;
|
1305
1310
|
}
|
1306
1311
|
|
1307
|
-
inline void Cord::InlineRep::CopyToArray(
|
1312
|
+
inline void Cord::InlineRep::CopyToArray(char* absl_nonnull dst) const {
|
1308
1313
|
assert(!is_tree());
|
1309
1314
|
size_t n = inline_size();
|
1310
1315
|
assert(n != 0);
|
@@ -1488,7 +1493,7 @@ inline bool Cord::StartsWith(absl::string_view rhs) const {
|
|
1488
1493
|
return EqualsImpl(rhs, rhs_size);
|
1489
1494
|
}
|
1490
1495
|
|
1491
|
-
inline void Cord::CopyToArrayImpl(
|
1496
|
+
inline void Cord::CopyToArrayImpl(char* absl_nonnull dst) const {
|
1492
1497
|
if (!contents_.is_tree()) {
|
1493
1498
|
if (!empty()) contents_.CopyToArray(dst);
|
1494
1499
|
} else {
|
@@ -1497,7 +1502,7 @@ inline void Cord::CopyToArrayImpl(absl::Nonnull<char*> dst) const {
|
|
1497
1502
|
}
|
1498
1503
|
|
1499
1504
|
inline void Cord::ChunkIterator::InitTree(
|
1500
|
-
|
1505
|
+
cord_internal::CordRep* absl_nonnull tree) {
|
1501
1506
|
tree = cord_internal::SkipCrcNode(tree);
|
1502
1507
|
if (tree->tag == cord_internal::BTREE) {
|
1503
1508
|
current_chunk_ = btree_reader_.Init(tree->btree());
|
@@ -1508,12 +1513,12 @@ inline void Cord::ChunkIterator::InitTree(
|
|
1508
1513
|
}
|
1509
1514
|
|
1510
1515
|
inline Cord::ChunkIterator::ChunkIterator(
|
1511
|
-
|
1516
|
+
cord_internal::CordRep* absl_nonnull tree) {
|
1512
1517
|
bytes_remaining_ = tree->length;
|
1513
1518
|
InitTree(tree);
|
1514
1519
|
}
|
1515
1520
|
|
1516
|
-
inline Cord::ChunkIterator::ChunkIterator(
|
1521
|
+
inline Cord::ChunkIterator::ChunkIterator(const Cord* absl_nonnull cord) {
|
1517
1522
|
if (CordRep* tree = cord->contents_.tree()) {
|
1518
1523
|
bytes_remaining_ = tree->length;
|
1519
1524
|
if (ABSL_PREDICT_TRUE(bytes_remaining_ != 0)) {
|
@@ -1649,13 +1654,13 @@ inline Cord::CharIterator::reference Cord::CharIterator::operator*() const {
|
|
1649
1654
|
return *chunk_iterator_->data();
|
1650
1655
|
}
|
1651
1656
|
|
1652
|
-
inline Cord Cord::AdvanceAndRead(
|
1657
|
+
inline Cord Cord::AdvanceAndRead(CharIterator* absl_nonnull it,
|
1653
1658
|
size_t n_bytes) {
|
1654
1659
|
assert(it != nullptr);
|
1655
1660
|
return it->chunk_iterator_.AdvanceAndReadBytes(n_bytes);
|
1656
1661
|
}
|
1657
1662
|
|
1658
|
-
inline void Cord::Advance(
|
1663
|
+
inline void Cord::Advance(CharIterator* absl_nonnull it, size_t n_bytes) {
|
1659
1664
|
assert(it != nullptr);
|
1660
1665
|
it->chunk_iterator_.AdvanceBytes(n_bytes);
|
1661
1666
|
}
|
@@ -1664,6 +1669,12 @@ inline absl::string_view Cord::ChunkRemaining(const CharIterator& it) {
|
|
1664
1669
|
return *it.chunk_iterator_;
|
1665
1670
|
}
|
1666
1671
|
|
1672
|
+
inline ptrdiff_t Cord::Distance(const CharIterator& first,
|
1673
|
+
const CharIterator& last) {
|
1674
|
+
return static_cast<ptrdiff_t>(first.chunk_iterator_.bytes_remaining_ -
|
1675
|
+
last.chunk_iterator_.bytes_remaining_);
|
1676
|
+
}
|
1677
|
+
|
1667
1678
|
inline Cord::CharIterator Cord::char_begin() const {
|
1668
1679
|
return CharIterator(this);
|
1669
1680
|
}
|
@@ -39,15 +39,15 @@ enum class Mode { kFairShare, kTotal, kTotalMorePrecise };
|
|
39
39
|
template <Mode mode>
|
40
40
|
struct CordRepRef {
|
41
41
|
// Instantiates a CordRepRef instance.
|
42
|
-
explicit CordRepRef(
|
42
|
+
explicit CordRepRef(const CordRep* absl_nonnull r) : rep(r) {}
|
43
43
|
|
44
44
|
// Creates a child reference holding the provided child.
|
45
45
|
// Overloaded to add cumulative reference count for kFairShare.
|
46
|
-
CordRepRef Child(
|
46
|
+
CordRepRef Child(const CordRep* absl_nonnull child) const {
|
47
47
|
return CordRepRef(child);
|
48
48
|
}
|
49
49
|
|
50
|
-
|
50
|
+
const CordRep* absl_nonnull rep;
|
51
51
|
};
|
52
52
|
|
53
53
|
// RawUsage holds the computed total number of bytes.
|
@@ -66,7 +66,7 @@ template <>
|
|
66
66
|
struct RawUsage<Mode::kTotalMorePrecise> {
|
67
67
|
size_t total = 0;
|
68
68
|
// TODO(b/289250880): Replace this with a flat_hash_set.
|
69
|
-
std::unordered_set<
|
69
|
+
std::unordered_set<const CordRep* absl_nonnull> counted;
|
70
70
|
|
71
71
|
void Add(size_t size, CordRepRef<Mode::kTotalMorePrecise> repref) {
|
72
72
|
if (counted.insert(repref.rep).second) {
|
@@ -90,15 +90,15 @@ double MaybeDiv(double d, refcount_t refcount) {
|
|
90
90
|
template <>
|
91
91
|
struct CordRepRef<Mode::kFairShare> {
|
92
92
|
// Creates a CordRepRef with the provided rep and top (parent) fraction.
|
93
|
-
explicit CordRepRef(
|
93
|
+
explicit CordRepRef(const CordRep* absl_nonnull r, double frac = 1.0)
|
94
94
|
: rep(r), fraction(MaybeDiv(frac, r->refcount.Get())) {}
|
95
95
|
|
96
96
|
// Returns a CordRepRef with a fraction of `this->fraction / child.refcount`
|
97
|
-
CordRepRef Child(
|
97
|
+
CordRepRef Child(const CordRep* absl_nonnull child) const {
|
98
98
|
return CordRepRef(child, fraction);
|
99
99
|
}
|
100
100
|
|
101
|
-
|
101
|
+
const CordRep* absl_nonnull rep;
|
102
102
|
double fraction;
|
103
103
|
};
|
104
104
|
|
@@ -150,7 +150,7 @@ void AnalyzeBtree(CordRepRef<mode> rep, RawUsage<mode>& raw_usage) {
|
|
150
150
|
}
|
151
151
|
|
152
152
|
template <Mode mode>
|
153
|
-
size_t GetEstimatedUsage(
|
153
|
+
size_t GetEstimatedUsage(const CordRep* absl_nonnull rep) {
|
154
154
|
// Zero initialized memory usage totals.
|
155
155
|
RawUsage<mode> raw_usage;
|
156
156
|
|
@@ -179,15 +179,15 @@ size_t GetEstimatedUsage(absl::Nonnull<const CordRep*> rep) {
|
|
179
179
|
|
180
180
|
} // namespace
|
181
181
|
|
182
|
-
size_t GetEstimatedMemoryUsage(
|
182
|
+
size_t GetEstimatedMemoryUsage(const CordRep* absl_nonnull rep) {
|
183
183
|
return GetEstimatedUsage<Mode::kTotal>(rep);
|
184
184
|
}
|
185
185
|
|
186
|
-
size_t GetEstimatedFairShareMemoryUsage(
|
186
|
+
size_t GetEstimatedFairShareMemoryUsage(const CordRep* absl_nonnull rep) {
|
187
187
|
return GetEstimatedUsage<Mode::kFairShare>(rep);
|
188
188
|
}
|
189
189
|
|
190
|
-
size_t GetMorePreciseMemoryUsage(
|
190
|
+
size_t GetMorePreciseMemoryUsage(const CordRep* absl_nonnull rep) {
|
191
191
|
return GetEstimatedUsage<Mode::kTotalMorePrecise>(rep);
|
192
192
|
}
|
193
193
|
|
@@ -29,7 +29,7 @@ namespace cord_internal {
|
|
29
29
|
// Returns the *approximate* number of bytes held in full or in part by this
|
30
30
|
// Cord (which may not remain the same between invocations). Cords that share
|
31
31
|
// memory could each be "charged" independently for the same shared memory.
|
32
|
-
size_t GetEstimatedMemoryUsage(
|
32
|
+
size_t GetEstimatedMemoryUsage(const CordRep* absl_nonnull rep);
|
33
33
|
|
34
34
|
// Returns the *approximate* number of bytes held in full or in part by this
|
35
35
|
// Cord for the distinct memory held by this cord. This is similar to
|
@@ -47,13 +47,13 @@ size_t GetEstimatedMemoryUsage(absl::Nonnull<const CordRep*> rep);
|
|
47
47
|
//
|
48
48
|
// This is more expensive than `GetEstimatedMemoryUsage()` as it requires
|
49
49
|
// deduplicating all memory references.
|
50
|
-
size_t GetMorePreciseMemoryUsage(
|
50
|
+
size_t GetMorePreciseMemoryUsage(const CordRep* absl_nonnull rep);
|
51
51
|
|
52
52
|
// Returns the *approximate* number of bytes held in full or in part by this
|
53
53
|
// CordRep weighted by the sharing ratio of that data. For example, if some data
|
54
54
|
// edge is shared by 4 different Cords, then each cord is attribute 1/4th of
|
55
55
|
// the total memory usage as a 'fair share' of the total memory usage.
|
56
|
-
size_t GetEstimatedFairShareMemoryUsage(
|
56
|
+
size_t GetEstimatedFairShareMemoryUsage(const CordRep* absl_nonnull rep);
|
57
57
|
|
58
58
|
} // namespace cord_internal
|
59
59
|
ABSL_NAMESPACE_END
|