grpc 1.52.2 → 1.53.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +50 -5
- data/include/grpc/event_engine/event_engine.h +24 -2
- data/include/grpc/event_engine/slice_buffer.h +13 -1
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/time.h +6 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +148 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +52 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +29 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +3 -3
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +29 -33
- data/src/core/ext/filters/client_channel/client_channel.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_factory.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/config_selector.h +3 -3
- data/src/core/ext/filters/client_channel/connector.h +8 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.h +3 -3
- data/src/core/ext/filters/client_channel/lb_call_state_internal.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +1 -78
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +117 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +128 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.h +71 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +972 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +12 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +275 -107
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.h +10 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +5 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +6 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +1 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +3 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/retry_filter.cc +10 -13
- data/src/core/ext/filters/client_channel/retry_filter.h +3 -3
- data/src/core/ext/filters/client_channel/retry_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +3 -3
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +4 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -1
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +3 -3
- data/src/core/ext/filters/deadline/deadline_filter.cc +40 -48
- data/src/core/ext/filters/deadline/deadline_filter.h +6 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +3 -3
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +3 -3
- data/src/core/ext/filters/http/client/http_client_filter.cc +26 -21
- data/src/core/ext/filters/http/client/http_client_filter.h +3 -3
- data/src/core/ext/filters/http/client_authority_filter.h +3 -3
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +109 -117
- data/src/core/ext/filters/http/message_compress/compression_filter.h +17 -10
- data/src/core/ext/filters/http/server/http_server_filter.cc +25 -24
- data/src/core/ext/filters/http/server/http_server_filter.h +3 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +2 -1
- data/src/core/ext/filters/message_size/message_size_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_filter.cc +4 -3
- data/src/core/ext/filters/rbac/rbac_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +27 -37
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +5 -5
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +3 -3
- data/src/core/ext/transport/chttp2/alpn/alpn.h +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +195 -111
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +3 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +17 -406
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http_trace.h +3 -3
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +3 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +28 -23
- data/src/core/ext/transport/chttp2/transport/parsing.cc +111 -31
- data/src/core/ext/transport/chttp2/transport/stream_map.h +3 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +3 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +9 -8
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +38 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +185 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +44 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +16 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +48 -74
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +30 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +137 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +15 -12
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +83 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +17 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +61 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +37 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +22 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -5
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +50 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +57 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +254 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +21 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +23 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +10 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +42 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +188 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +111 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +444 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +31 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +113 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +114 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +3 -1
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +54 -53
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +34 -13
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +195 -187
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +232 -224
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +95 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +94 -93
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +81 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +189 -187
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +7 -3
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -133
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +140 -133
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +81 -70
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +771 -741
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +16 -14
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +20 -18
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +53 -42
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +363 -356
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +149 -145
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +14 -14
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +10 -9
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +1 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/ext/xds/upb_utils.h +3 -3
- data/src/core/ext/xds/xds_api.h +3 -3
- data/src/core/ext/xds/xds_bootstrap.h +3 -3
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +1 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +3 -3
- data/src/core/ext/xds/xds_certificate_provider.h +3 -3
- data/src/core/ext/xds/xds_channel_args.h +3 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.h +3 -3
- data/src/core/ext/xds/xds_client.cc +8 -3
- data/src/core/ext/xds/xds_client.h +3 -3
- data/src/core/ext/xds/xds_client_grpc.cc +0 -1
- data/src/core/ext/xds/xds_client_grpc.h +3 -3
- data/src/core/ext/xds/xds_client_stats.h +4 -3
- data/src/core/ext/xds/xds_cluster.cc +11 -7
- data/src/core/ext/xds/xds_cluster.h +6 -6
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +3 -3
- data/src/core/ext/xds/xds_common_types.cc +1 -0
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +1 -1
- data/src/core/ext/xds/xds_endpoint.h +3 -3
- data/src/core/ext/xds/xds_health_status.h +30 -3
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -3
- data/src/core/ext/xds/xds_http_filters.cc +1 -1
- data/src/core/ext/xds/xds_http_filters.h +3 -3
- data/src/core/ext/xds/xds_http_rbac_filter.h +3 -3
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +3 -3
- data/src/core/ext/xds/xds_lb_policy_registry.cc +95 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +3 -3
- data/src/core/ext/xds/xds_listener.cc +1 -0
- data/src/core/ext/xds/xds_listener.h +3 -3
- data/src/core/ext/xds/xds_resource_type.h +3 -3
- data/src/core/ext/xds/xds_resource_type_impl.h +3 -3
- data/src/core/ext/xds/xds_route_config.cc +6 -0
- data/src/core/ext/xds/xds_route_config.h +3 -3
- data/src/core/ext/xds/xds_routing.h +3 -3
- data/src/core/ext/xds/xds_transport.h +3 -3
- data/src/core/ext/xds/xds_transport_grpc.h +3 -3
- data/src/core/lib/address_utils/parse_address.h +3 -3
- data/src/core/lib/address_utils/sockaddr_utils.cc +1 -0
- data/src/core/lib/address_utils/sockaddr_utils.h +3 -3
- data/src/core/lib/avl/avl.h +3 -3
- data/src/core/lib/backoff/backoff.h +3 -3
- data/src/core/lib/channel/call_finalization.h +3 -3
- data/src/core/lib/channel/call_tracer.h +3 -3
- data/src/core/lib/channel/channel_args.cc +1 -0
- data/src/core/lib/channel/channel_args.h +11 -5
- data/src/core/lib/channel/channel_args_preconditioning.h +3 -3
- data/src/core/lib/channel/channel_fwd.h +3 -3
- data/src/core/lib/channel/channel_stack.cc +1 -2
- data/src/core/lib/channel/channel_stack.h +4 -4
- data/src/core/lib/channel/channel_stack_builder.h +3 -3
- data/src/core/lib/channel/channel_stack_builder_impl.cc +14 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +3 -3
- data/src/core/lib/channel/channel_trace.h +3 -3
- data/src/core/lib/channel/channelz.h +3 -3
- data/src/core/lib/channel/channelz_registry.h +3 -3
- data/src/core/lib/channel/connected_channel.cc +883 -354
- data/src/core/lib/channel/connected_channel.h +3 -3
- data/src/core/lib/channel/context.h +7 -3
- data/src/core/lib/channel/promise_based_filter.cc +509 -259
- data/src/core/lib/channel/promise_based_filter.h +118 -43
- data/src/core/lib/channel/status_util.h +3 -3
- data/src/core/lib/compression/compression_internal.h +3 -3
- data/src/core/lib/compression/message_compress.h +3 -3
- data/src/core/lib/config/core_configuration.h +3 -3
- data/src/core/lib/debug/event_log.h +3 -3
- data/src/core/lib/debug/histogram_view.h +3 -3
- data/src/core/lib/debug/stats.h +3 -3
- data/src/core/lib/debug/stats_data.cc +66 -65
- data/src/core/lib/debug/stats_data.h +42 -33
- data/src/core/lib/debug/trace.h +4 -26
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +5 -0
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -3
- data/src/core/lib/event_engine/common_closures.h +3 -3
- data/src/core/lib/event_engine/default_event_engine.cc +9 -4
- data/src/core/lib/event_engine/default_event_engine.h +30 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +3 -3
- data/src/core/lib/event_engine/event_engine.cc +25 -0
- data/src/core/lib/event_engine/executor/executor.h +3 -3
- data/src/core/lib/event_engine/forkable.cc +11 -6
- data/src/core/lib/event_engine/forkable.h +3 -3
- data/src/core/lib/event_engine/handle_containers.h +10 -3
- data/src/core/lib/event_engine/poller.h +3 -3
- data/src/core/lib/event_engine/posix.h +158 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +44 -16
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +14 -4
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +6 -7
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +3 -3
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +3 -3
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +52 -55
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +46 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +82 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +23 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +60 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +65 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +0 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -6
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +19 -0
- data/src/core/lib/event_engine/resolved_address_internal.h +34 -0
- data/src/core/lib/event_engine/shim.cc +56 -0
- data/src/core/lib/event_engine/shim.h +33 -0
- data/src/core/lib/event_engine/slice.cc +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +18 -2
- data/src/core/lib/event_engine/tcp_socket_utils.h +8 -3
- data/src/core/lib/event_engine/thread_local.cc +29 -0
- data/src/core/lib/event_engine/thread_local.h +32 -0
- data/src/core/lib/event_engine/thread_pool.cc +41 -65
- data/src/core/lib/event_engine/thread_pool.h +21 -17
- data/src/core/lib/event_engine/time_util.h +3 -3
- data/src/core/lib/event_engine/trace.cc +6 -0
- data/src/core/lib/event_engine/trace.h +16 -3
- data/src/core/lib/event_engine/utils.cc +2 -2
- data/src/core/lib/event_engine/utils.h +12 -4
- data/src/core/lib/event_engine/windows/iocp.cc +24 -40
- data/src/core/lib/event_engine/windows/iocp.h +3 -3
- data/src/core/lib/event_engine/windows/win_socket.cc +56 -33
- data/src/core/lib/event_engine/windows/win_socket.h +34 -25
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +331 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +103 -0
- data/src/core/lib/event_engine/windows/windows_engine.cc +243 -20
- data/src/core/lib/event_engine/windows/windows_engine.h +62 -23
- data/src/core/lib/experiments/config.cc +16 -1
- data/src/core/lib/experiments/config.h +13 -3
- data/src/core/lib/experiments/experiments.cc +14 -8
- data/src/core/lib/experiments/experiments.h +80 -21
- data/src/core/lib/gpr/alloc.h +3 -3
- data/src/core/lib/gpr/spinlock.h +3 -3
- data/src/core/lib/gpr/string.h +3 -3
- data/src/core/lib/gpr/sync_abseil.cc +15 -7
- data/src/core/lib/gpr/time_precise.h +3 -3
- data/src/core/lib/gpr/tmpfile.h +3 -3
- data/src/core/lib/gpr/useful.h +3 -3
- data/src/core/lib/gprpp/atomic_utils.h +3 -3
- data/src/core/lib/gprpp/bitset.h +3 -3
- data/src/core/lib/gprpp/chunked_vector.h +3 -3
- data/src/core/lib/gprpp/construct_destruct.h +3 -3
- data/src/core/lib/gprpp/cpp_impl_of.h +3 -3
- data/src/core/lib/gprpp/crash.h +3 -3
- data/src/core/lib/gprpp/debug_location.h +3 -6
- data/src/core/lib/gprpp/dual_ref_counted.h +3 -3
- data/src/core/lib/gprpp/env.h +3 -3
- data/src/core/lib/gprpp/examine_stack.h +3 -3
- data/src/core/lib/gprpp/fork.cc +21 -4
- data/src/core/lib/gprpp/fork.h +7 -5
- data/src/core/lib/gprpp/global_config.h +3 -3
- data/src/core/lib/gprpp/global_config_custom.h +3 -3
- data/src/core/lib/gprpp/global_config_env.cc +1 -0
- data/src/core/lib/gprpp/global_config_env.h +3 -3
- data/src/core/lib/gprpp/global_config_generic.h +3 -3
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/load_file.h +3 -3
- data/src/core/lib/gprpp/manual_constructor.h +3 -3
- data/src/core/lib/gprpp/match.h +3 -3
- data/src/core/lib/gprpp/memory.h +3 -3
- data/src/core/lib/gprpp/mpscq.h +3 -3
- data/src/core/lib/gprpp/no_destruct.h +3 -3
- data/src/core/lib/gprpp/notification.h +3 -3
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/overload.h +3 -3
- data/src/core/lib/gprpp/packed_table.h +3 -3
- data/src/core/lib/gprpp/per_cpu.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -3
- data/src/core/lib/gprpp/single_set_ptr.h +3 -3
- data/src/core/lib/gprpp/sorted_pack.h +3 -3
- data/src/core/lib/gprpp/stat.h +3 -3
- data/src/core/lib/gprpp/status_helper.h +3 -3
- data/src/core/lib/gprpp/strerror.cc +2 -0
- data/src/core/lib/gprpp/strerror.h +3 -3
- data/src/core/lib/gprpp/sync.h +3 -3
- data/src/core/lib/gprpp/table.h +3 -3
- data/src/core/lib/gprpp/tchar.h +3 -3
- data/src/core/lib/gprpp/thd.h +3 -3
- data/src/core/lib/gprpp/time.cc +1 -0
- data/src/core/lib/gprpp/time.h +3 -3
- data/src/core/lib/gprpp/time_averaged_stats.h +3 -3
- data/src/core/lib/gprpp/time_util.h +3 -3
- data/src/core/lib/gprpp/unique_type_name.h +3 -3
- data/src/core/lib/gprpp/validation_errors.h +3 -3
- data/src/core/lib/gprpp/work_serializer.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper_registry.h +3 -3
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +3 -3
- data/src/core/lib/http/httpcli.cc +1 -0
- data/src/core/lib/http/httpcli.h +3 -3
- data/src/core/lib/http/httpcli_ssl_credentials.h +3 -3
- data/src/core/lib/http/parser.h +3 -3
- data/src/core/lib/iomgr/block_annotate.h +3 -3
- data/src/core/lib/iomgr/buffer_list.h +3 -3
- data/src/core/lib/iomgr/call_combiner.cc +4 -4
- data/src/core/lib/iomgr/call_combiner.h +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +3 -3
- data/src/core/lib/iomgr/closure.cc +27 -0
- data/src/core/lib/iomgr/closure.h +5 -3
- data/src/core/lib/iomgr/combiner.h +3 -3
- data/src/core/lib/iomgr/dynamic_annotations.h +3 -3
- data/src/core/lib/iomgr/endpoint.h +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +10 -2
- data/src/core/lib/iomgr/error.h +3 -3
- data/src/core/lib/iomgr/error_cfstream.h +3 -3
- data/src/core/lib/iomgr/ev_apple.h +3 -3
- data/src/core/lib/iomgr/ev_epoll1_linux.h +3 -3
- data/src/core/lib/iomgr/ev_poll_posix.h +3 -3
- data/src/core/lib/iomgr/ev_posix.h +3 -3
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +62 -0
- data/src/core/lib/iomgr/event_engine_shims/closure.h +39 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +430 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +43 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +91 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.h +44 -0
- data/src/core/lib/iomgr/exec_ctx.h +3 -3
- data/src/core/lib/iomgr/executor.h +3 -3
- data/src/core/lib/iomgr/fork_posix.cc +5 -4
- data/src/core/lib/iomgr/gethostname.h +3 -3
- data/src/core/lib/iomgr/grpc_if_nametoindex.h +3 -3
- data/src/core/lib/iomgr/internal_errqueue.h +3 -3
- data/src/core/lib/iomgr/iocp_windows.h +3 -3
- data/src/core/lib/iomgr/iomgr.h +3 -3
- data/src/core/lib/iomgr/iomgr_fwd.h +3 -3
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/load_file.h +3 -3
- data/src/core/lib/iomgr/lockfree_event.h +3 -3
- data/src/core/lib/iomgr/nameser.h +3 -3
- data/src/core/lib/iomgr/polling_entity.h +3 -3
- data/src/core/lib/iomgr/pollset.h +3 -3
- data/src/core/lib/iomgr/pollset_set.h +3 -3
- data/src/core/lib/iomgr/pollset_set_windows.h +3 -3
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/pollset_windows.h +3 -3
- data/src/core/lib/iomgr/port.h +3 -3
- data/src/core/lib/iomgr/python_util.h +3 -3
- data/src/core/lib/iomgr/resolve_address.h +3 -3
- data/src/core/lib/iomgr/resolve_address_impl.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.h +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.h +3 -3
- data/src/core/lib/iomgr/resolved_address.h +3 -3
- data/src/core/lib/iomgr/sockaddr.h +3 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +3 -3
- data/src/core/lib/iomgr/sockaddr_windows.h +3 -3
- data/src/core/lib/iomgr/socket_factory_posix.h +3 -3
- data/src/core/lib/iomgr/socket_mutator.h +3 -3
- data/src/core/lib/iomgr/socket_utils.h +3 -3
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -3
- data/src/core/lib/iomgr/socket_windows.h +3 -3
- data/src/core/lib/iomgr/systemd_utils.cc +19 -19
- data/src/core/lib/iomgr/systemd_utils.h +24 -24
- data/src/core/lib/iomgr/tcp_client.h +3 -3
- data/src/core/lib/iomgr/tcp_client_posix.cc +12 -0
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_client_windows.cc +13 -1
- data/src/core/lib/iomgr/tcp_posix.cc +49 -65
- data/src/core/lib/iomgr/tcp_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_server.h +3 -3
- data/src/core/lib/iomgr/tcp_server_posix.cc +219 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +4 -6
- data/src/core/lib/iomgr/tcp_windows.h +3 -3
- data/src/core/lib/iomgr/timer.h +3 -3
- data/src/core/lib/iomgr/timer_generic.h +3 -3
- data/src/core/lib/iomgr/timer_heap.h +3 -3
- data/src/core/lib/iomgr/timer_manager.h +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -3
- data/src/core/lib/json/json.h +3 -3
- data/src/core/lib/json/json_args.h +3 -3
- data/src/core/lib/json/json_channel_args.h +3 -3
- data/src/core/lib/json/json_object_loader.h +3 -3
- data/src/core/lib/json/json_reader.cc +1 -0
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/load_balancing/lb_policy.cc +9 -0
- data/src/core/lib/load_balancing/lb_policy.h +9 -5
- data/src/core/lib/load_balancing/lb_policy_factory.h +3 -3
- data/src/core/lib/load_balancing/lb_policy_registry.cc +1 -0
- data/src/core/lib/load_balancing/lb_policy_registry.h +3 -3
- data/src/core/lib/load_balancing/subchannel_interface.h +8 -6
- data/src/core/lib/matchers/matchers.cc +1 -0
- data/src/core/lib/matchers/matchers.h +3 -3
- data/src/core/lib/promise/activity.cc +8 -6
- data/src/core/lib/promise/activity.h +52 -66
- data/src/core/lib/promise/arena_promise.h +3 -3
- data/src/core/lib/promise/context.h +3 -3
- data/src/core/lib/promise/detail/basic_join.h +197 -0
- data/src/core/lib/promise/detail/basic_seq.h +10 -16
- data/src/core/lib/promise/detail/promise_factory.h +3 -3
- data/src/core/lib/promise/detail/promise_like.h +3 -3
- data/src/core/lib/promise/detail/status.h +3 -3
- data/src/core/lib/promise/detail/switch.h +3 -3
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +3 -3
- data/src/core/lib/promise/if.h +195 -0
- data/src/core/lib/promise/interceptor_list.h +308 -0
- data/src/core/lib/promise/intra_activity_waiter.h +9 -3
- data/src/core/lib/promise/latch.h +99 -5
- data/src/core/lib/promise/loop.h +4 -4
- data/src/core/lib/promise/map.h +4 -6
- data/src/core/lib/promise/pipe.h +296 -193
- data/src/core/lib/promise/poll.h +113 -14
- data/src/core/lib/promise/promise.h +4 -5
- data/src/core/lib/promise/race.h +6 -9
- data/src/core/lib/promise/seq.h +3 -3
- data/src/core/lib/promise/sleep.h +3 -3
- data/src/core/lib/promise/{pipe.cc → trace.cc} +3 -2
- data/src/core/lib/promise/trace.h +24 -0
- data/src/core/lib/promise/try_join.h +82 -0
- data/src/core/lib/promise/try_seq.h +3 -3
- data/src/core/lib/resolver/resolver.h +3 -3
- data/src/core/lib/resolver/resolver_factory.h +4 -4
- data/src/core/lib/resolver/resolver_registry.cc +15 -0
- data/src/core/lib/resolver/resolver_registry.h +3 -3
- data/src/core/lib/resolver/server_address.cc +1 -0
- data/src/core/lib/resolver/server_address.h +3 -3
- data/src/core/lib/resource_quota/api.h +3 -3
- data/src/core/lib/resource_quota/arena.cc +36 -9
- data/src/core/lib/resource_quota/arena.h +84 -22
- data/src/core/lib/resource_quota/memory_quota.h +3 -3
- data/src/core/lib/resource_quota/periodic_update.h +3 -3
- data/src/core/lib/resource_quota/resource_quota.h +3 -3
- data/src/core/lib/resource_quota/thread_quota.h +3 -3
- data/src/core/lib/resource_quota/trace.h +3 -3
- data/src/core/lib/security/authorization/authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/authorization_policy_provider.h +3 -3
- data/src/core/lib/security/authorization/evaluate_args.h +3 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +3 -3
- data/src/core/lib/security/authorization/matchers.h +3 -3
- data/src/core/lib/security/authorization/rbac_policy.cc +1 -0
- data/src/core/lib/security/authorization/rbac_policy.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +3 -3
- data/src/core/lib/security/context/security_context.h +3 -3
- data/src/core/lib/security/credentials/alts/alts_credentials.h +3 -3
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +3 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +3 -3
- data/src/core/lib/security/credentials/channel_creds_registry.h +3 -3
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -3
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +3 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +3 -3
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +1 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +3 -3
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +3 -3
- data/src/core/lib/security/credentials/jwt/json_token.h +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/local/local_credentials.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +4 -3
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +3 -3
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_utils.h +3 -3
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +3 -3
- data/src/core/lib/security/security_connector/local/local_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils_config.h +3 -3
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +3 -3
- data/src/core/lib/security/transport/auth_filters.h +27 -5
- data/src/core/lib/security/transport/secure_endpoint.h +3 -3
- data/src/core/lib/security/transport/security_handshaker.cc +9 -0
- data/src/core/lib/security/transport/security_handshaker.h +3 -3
- data/src/core/lib/security/transport/server_auth_filter.cc +120 -251
- data/src/core/lib/security/transport/tsi_error.h +3 -3
- data/src/core/lib/security/util/json_util.h +3 -3
- data/src/core/lib/service_config/service_config.h +3 -3
- data/src/core/lib/service_config/service_config_call_data.h +3 -3
- data/src/core/lib/service_config/service_config_impl.h +3 -3
- data/src/core/lib/service_config/service_config_parser.h +3 -3
- data/src/core/lib/slice/b64.h +3 -3
- data/src/core/lib/slice/percent_encoding.h +3 -3
- data/src/core/lib/slice/slice.cc +3 -3
- data/src/core/lib/slice/slice.h +14 -21
- data/src/core/lib/slice/slice_buffer.h +10 -4
- data/src/core/lib/slice/slice_internal.h +3 -3
- data/src/core/lib/slice/slice_refcount.cc +20 -0
- data/src/core/lib/slice/slice_refcount.h +26 -6
- data/src/core/lib/slice/slice_string_helpers.h +3 -3
- data/src/core/lib/surface/api_trace.h +3 -3
- data/src/core/lib/surface/builtins.h +3 -3
- data/src/core/lib/surface/call.cc +866 -252
- data/src/core/lib/surface/call.h +31 -3
- data/src/core/lib/surface/call_log_batch.cc +1 -0
- data/src/core/lib/surface/call_test_only.h +3 -3
- data/src/core/lib/surface/call_trace.cc +21 -11
- data/src/core/lib/surface/call_trace.h +3 -3
- data/src/core/lib/surface/channel.h +3 -3
- data/src/core/lib/surface/channel_init.h +3 -3
- data/src/core/lib/surface/channel_stack_type.h +3 -3
- data/src/core/lib/surface/completion_queue.cc +1 -0
- data/src/core/lib/surface/completion_queue.h +3 -3
- data/src/core/lib/surface/completion_queue_factory.h +3 -3
- data/src/core/lib/surface/event_string.cc +1 -0
- data/src/core/lib/surface/event_string.h +3 -3
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init.h +3 -3
- data/src/core/lib/surface/init_internally.h +3 -3
- data/src/core/lib/surface/lame_client.cc +3 -1
- data/src/core/lib/surface/lame_client.h +3 -3
- data/src/core/lib/surface/server.cc +273 -27
- data/src/core/lib/surface/server.h +6 -3
- data/src/core/lib/surface/validate_metadata.h +3 -3
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/connectivity_state.h +3 -3
- data/src/core/lib/transport/error_utils.h +3 -3
- data/src/core/lib/transport/handshaker.cc +11 -0
- data/src/core/lib/transport/handshaker.h +4 -4
- data/src/core/lib/transport/handshaker_factory.h +3 -3
- data/src/core/lib/transport/handshaker_registry.h +3 -3
- data/src/core/lib/transport/http2_errors.h +3 -3
- data/src/core/lib/transport/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.h +3 -3
- data/src/core/lib/transport/parsed_metadata.h +3 -3
- data/src/core/lib/transport/pid_controller.h +3 -3
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +0 -1
- data/src/core/lib/transport/tcp_connect_handshaker.h +3 -3
- data/src/core/lib/transport/timeout_encoding.h +3 -3
- data/src/core/lib/transport/transport.cc +3 -8
- data/src/core/lib/transport/transport.h +16 -8
- data/src/core/lib/transport/transport_fwd.h +3 -3
- data/src/core/lib/transport/transport_impl.h +3 -3
- data/src/core/lib/transport/transport_op_string.cc +1 -0
- data/src/core/lib/uri/uri_parser.cc +1 -1
- data/src/core/lib/uri/uri_parser.h +3 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +5 -0
- data/src/core/tsi/alts/crypt/gsec.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_counter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +3 -3
- data/src/core/tsi/alts/frame_protector/frame_handler.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +3 -3
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +3 -3
- data/src/core/tsi/fake_transport_security.h +3 -3
- data/src/core/tsi/local_transport_security.h +3 -3
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -3
- data/src/core/tsi/ssl_transport_security.cc +113 -24
- data/src/core/tsi/ssl_transport_security.h +5 -3
- data/src/core/tsi/ssl_transport_security_utils.h +3 -3
- data/src/core/tsi/ssl_types.h +3 -3
- data/src/core/tsi/transport_security.h +3 -3
- data/src/core/tsi/transport_security_grpc.h +3 -3
- data/src/core/tsi/transport_security_interface.h +3 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +0 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +56 -57
- data/third_party/abseil-cpp/absl/base/attributes.h +39 -19
- data/third_party/abseil-cpp/absl/base/config.h +44 -3
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +3 -18
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +10 -6
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +23 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +2 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +4 -1
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +14 -10
- data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +9 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -40
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
- data/third_party/abseil-cpp/absl/base/macros.h +4 -21
- data/third_party/abseil-cpp/absl/base/optimization.h +58 -6
- data/third_party/abseil-cpp/absl/base/options.h +1 -7
- data/third_party/abseil-cpp/absl/base/policy_checks.h +15 -13
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -5
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -7
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +66 -18
- data/third_party/abseil-cpp/absl/container/internal/common.h +3 -3
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +132 -0
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +13 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +4 -55
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +50 -5
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +14 -46
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +110 -32
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +155 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +661 -341
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +99 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.h +183 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +256 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +57 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +468 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +91 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +269 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +130 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +179 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy.h +119 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +75 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +434 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +725 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +79 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +180 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +67 -38
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -13
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -9
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +40 -85
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +5 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -8
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +118 -94
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +7 -6
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +5 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +47 -26
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +10 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +18 -4
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +3 -14
- data/third_party/abseil-cpp/absl/memory/memory.h +26 -447
- data/third_party/abseil-cpp/absl/meta/type_traits.h +104 -12
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -3
- data/third_party/abseil-cpp/absl/numeric/int128.cc +10 -8
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +14 -6
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +2 -23
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +9 -9
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +2 -2
- data/third_party/abseil-cpp/absl/random/random.h +6 -6
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +1 -0
- data/third_party/abseil-cpp/absl/status/status.cc +19 -12
- data/third_party/abseil-cpp/absl/status/status.h +2 -2
- data/third_party/abseil-cpp/absl/strings/ascii.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/charconv.cc +534 -96
- data/third_party/abseil-cpp/absl/strings/cord.cc +92 -40
- data/third_party/abseil-cpp/absl/strings/cord.h +71 -80
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +8 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +73 -62
- data/third_party/abseil-cpp/absl/strings/escaping.h +24 -19
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +14 -12
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +326 -70
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +8 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +26 -14
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +9 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +7 -15
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +8 -5
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +34 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +12 -10
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +7 -9
- data/third_party/abseil-cpp/absl/strings/internal/has_absl_stringify.h +55 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +14 -7
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +35 -10
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +113 -46
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +126 -29
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +4 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +49 -287
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +351 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +215 -181
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +10 -209
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +10 -101
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +57 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +34 -31
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.h +50 -3
- data/third_party/abseil-cpp/absl/strings/str_format.h +71 -9
- data/third_party/abseil-cpp/absl/strings/string_view.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -10
- data/third_party/abseil-cpp/absl/strings/substitute.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +46 -20
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +20 -17
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +37 -31
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +22 -8
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +104 -55
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +85 -46
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +0 -1
- data/third_party/abseil-cpp/absl/synchronization/notification.h +0 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +26 -0
- data/third_party/abseil-cpp/absl/time/civil_time.h +25 -0
- data/third_party/abseil-cpp/absl/time/clock.cc +17 -11
- data/third_party/abseil-cpp/absl/time/duration.cc +7 -7
- data/third_party/abseil-cpp/absl/time/format.cc +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +26 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +7 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +36 -35
- data/third_party/abseil-cpp/absl/time/time.cc +2 -2
- data/third_party/abseil-cpp/absl/time/time.h +253 -158
- data/third_party/abseil-cpp/absl/types/internal/span.h +30 -19
- data/third_party/abseil-cpp/absl/types/internal/variant.h +28 -40
- data/third_party/abseil-cpp/absl/types/span.h +29 -7
- metadata +75 -10
- data/src/core/lib/event_engine/socket_notifier.h +0 -55
- data/src/core/lib/promise/for_each.h +0 -155
- data/src/core/lib/promise/map_pipe.h +0 -88
- data/src/core/lib/promise/try_concurrently.h +0 -342
@@ -75,32 +75,6 @@ std::unique_ptr<T> WrapUnique(T* ptr) {
|
|
75
75
|
return std::unique_ptr<T>(ptr);
|
76
76
|
}
|
77
77
|
|
78
|
-
namespace memory_internal {
|
79
|
-
|
80
|
-
// Traits to select proper overload and return type for `absl::make_unique<>`.
|
81
|
-
template <typename T>
|
82
|
-
struct MakeUniqueResult {
|
83
|
-
using scalar = std::unique_ptr<T>;
|
84
|
-
};
|
85
|
-
template <typename T>
|
86
|
-
struct MakeUniqueResult<T[]> {
|
87
|
-
using array = std::unique_ptr<T[]>;
|
88
|
-
};
|
89
|
-
template <typename T, size_t N>
|
90
|
-
struct MakeUniqueResult<T[N]> {
|
91
|
-
using invalid = void;
|
92
|
-
};
|
93
|
-
|
94
|
-
} // namespace memory_internal
|
95
|
-
|
96
|
-
// gcc 4.8 has __cplusplus at 201301 but the libstdc++ shipped with it doesn't
|
97
|
-
// define make_unique. Other supported compilers either just define __cplusplus
|
98
|
-
// as 201103 but have make_unique (msvc), or have make_unique whenever
|
99
|
-
// __cplusplus > 201103 (clang).
|
100
|
-
#if (__cplusplus > 201103L || defined(_MSC_VER)) && \
|
101
|
-
!(defined(__GLIBCXX__) && !defined(__cpp_lib_make_unique))
|
102
|
-
using std::make_unique;
|
103
|
-
#else
|
104
78
|
// -----------------------------------------------------------------------------
|
105
79
|
// Function Template: make_unique<T>()
|
106
80
|
// -----------------------------------------------------------------------------
|
@@ -109,82 +83,18 @@ using std::make_unique;
|
|
109
83
|
// during the construction process. `absl::make_unique<>` also avoids redundant
|
110
84
|
// type declarations, by avoiding the need to explicitly use the `new` operator.
|
111
85
|
//
|
112
|
-
//
|
113
|
-
// will be replaced in C++14 by the equivalent `std::make_unique<>` abstraction.
|
114
|
-
// `absl::make_unique<>` is designed to be 100% compatible with
|
115
|
-
// `std::make_unique<>` so that the eventual migration will involve a simple
|
116
|
-
// rename operation.
|
86
|
+
// https://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique
|
117
87
|
//
|
118
88
|
// For more background on why `std::unique_ptr<T>(new T(a,b))` is problematic,
|
119
89
|
// see Herb Sutter's explanation on
|
120
90
|
// (Exception-Safe Function Calls)[https://herbsutter.com/gotw/_102/].
|
121
91
|
// (In general, reviewers should treat `new T(a,b)` with scrutiny.)
|
122
92
|
//
|
123
|
-
//
|
124
|
-
//
|
125
|
-
//
|
126
|
-
//
|
127
|
-
|
128
|
-
// Three overloads of `absl::make_unique` are required:
|
129
|
-
//
|
130
|
-
// - For non-array T:
|
131
|
-
//
|
132
|
-
// Allocates a T with `new T(std::forward<Args> args...)`,
|
133
|
-
// forwarding all `args` to T's constructor.
|
134
|
-
// Returns a `std::unique_ptr<T>` owning that object.
|
135
|
-
//
|
136
|
-
// - For an array of unknown bounds T[]:
|
137
|
-
//
|
138
|
-
// `absl::make_unique<>` will allocate an array T of type U[] with
|
139
|
-
// `new U[n]()` and return a `std::unique_ptr<U[]>` owning that array.
|
140
|
-
//
|
141
|
-
// Note that 'U[n]()' is different from 'U[n]', and elements will be
|
142
|
-
// value-initialized. Note as well that `std::unique_ptr` will perform its
|
143
|
-
// own destruction of the array elements upon leaving scope, even though
|
144
|
-
// the array [] does not have a default destructor.
|
145
|
-
//
|
146
|
-
// NOTE: an array of unknown bounds T[] may still be (and often will be)
|
147
|
-
// initialized to have a size, and will still use this overload. E.g:
|
148
|
-
//
|
149
|
-
// auto my_array = absl::make_unique<int[]>(10);
|
150
|
-
//
|
151
|
-
// - For an array of known bounds T[N]:
|
152
|
-
//
|
153
|
-
// `absl::make_unique<>` is deleted (like with `std::make_unique<>`) as
|
154
|
-
// this overload is not useful.
|
155
|
-
//
|
156
|
-
// NOTE: an array of known bounds T[N] is not considered a useful
|
157
|
-
// construction, and may cause undefined behavior in templates. E.g:
|
158
|
-
//
|
159
|
-
// auto my_array = absl::make_unique<int[10]>();
|
160
|
-
//
|
161
|
-
// In those cases, of course, you can still use the overload above and
|
162
|
-
// simply initialize it to its desired size:
|
163
|
-
//
|
164
|
-
// auto my_array = absl::make_unique<int[]>(10);
|
165
|
-
|
166
|
-
// `absl::make_unique` overload for non-array types.
|
167
|
-
template <typename T, typename... Args>
|
168
|
-
typename memory_internal::MakeUniqueResult<T>::scalar make_unique(
|
169
|
-
Args&&... args) {
|
170
|
-
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
171
|
-
}
|
172
|
-
|
173
|
-
// `absl::make_unique` overload for an array T[] of unknown bounds.
|
174
|
-
// The array allocation needs to use the `new T[size]` form and cannot take
|
175
|
-
// element constructor arguments. The `std::unique_ptr` will manage destructing
|
176
|
-
// these array elements.
|
177
|
-
template <typename T>
|
178
|
-
typename memory_internal::MakeUniqueResult<T>::array make_unique(size_t n) {
|
179
|
-
return std::unique_ptr<T>(new typename absl::remove_extent_t<T>[n]());
|
180
|
-
}
|
181
|
-
|
182
|
-
// `absl::make_unique` overload for an array T[N] of known bounds.
|
183
|
-
// This construction will be rejected.
|
184
|
-
template <typename T, typename... Args>
|
185
|
-
typename memory_internal::MakeUniqueResult<T>::invalid make_unique(
|
186
|
-
Args&&... /* args */) = delete;
|
187
|
-
#endif
|
93
|
+
// Historical note: Abseil once provided a C++11 compatible implementation of
|
94
|
+
// the C++14's `std::make_unique`. Now that C++11 support has been sunsetted,
|
95
|
+
// `absl::make_unique` simply uses the STL-provided implementation. New code
|
96
|
+
// should use `std::make_unique`.
|
97
|
+
using std::make_unique;
|
188
98
|
|
189
99
|
// -----------------------------------------------------------------------------
|
190
100
|
// Function Template: RawPtr()
|
@@ -248,6 +158,26 @@ std::weak_ptr<T> WeakenPtr(const std::shared_ptr<T>& ptr) {
|
|
248
158
|
return std::weak_ptr<T>(ptr);
|
249
159
|
}
|
250
160
|
|
161
|
+
// -----------------------------------------------------------------------------
|
162
|
+
// Class Template: pointer_traits
|
163
|
+
// -----------------------------------------------------------------------------
|
164
|
+
//
|
165
|
+
// Historical note: Abseil once provided an implementation of
|
166
|
+
// `std::pointer_traits` for platforms that had not yet provided it. Those
|
167
|
+
// platforms are no longer supported. New code should simply use
|
168
|
+
// `std::pointer_traits`.
|
169
|
+
using std::pointer_traits;
|
170
|
+
|
171
|
+
// -----------------------------------------------------------------------------
|
172
|
+
// Class Template: allocator_traits
|
173
|
+
// -----------------------------------------------------------------------------
|
174
|
+
//
|
175
|
+
// Historical note: Abseil once provided an implementation of
|
176
|
+
// `std::allocator_traits` for platforms that had not yet provided it. Those
|
177
|
+
// platforms are no longer supported. New code should simply use
|
178
|
+
// `std::allocator_traits`.
|
179
|
+
using std::allocator_traits;
|
180
|
+
|
251
181
|
namespace memory_internal {
|
252
182
|
|
253
183
|
// ExtractOr<E, O, D>::type evaluates to E<O> if possible. Otherwise, D.
|
@@ -265,357 +195,6 @@ struct ExtractOr<Extract, Obj, Default, void_t<Extract<Obj>>> {
|
|
265
195
|
template <template <typename> class Extract, typename Obj, typename Default>
|
266
196
|
using ExtractOrT = typename ExtractOr<Extract, Obj, Default, void>::type;
|
267
197
|
|
268
|
-
// Extractors for the features of allocators.
|
269
|
-
template <typename T>
|
270
|
-
using GetPointer = typename T::pointer;
|
271
|
-
|
272
|
-
template <typename T>
|
273
|
-
using GetConstPointer = typename T::const_pointer;
|
274
|
-
|
275
|
-
template <typename T>
|
276
|
-
using GetVoidPointer = typename T::void_pointer;
|
277
|
-
|
278
|
-
template <typename T>
|
279
|
-
using GetConstVoidPointer = typename T::const_void_pointer;
|
280
|
-
|
281
|
-
template <typename T>
|
282
|
-
using GetDifferenceType = typename T::difference_type;
|
283
|
-
|
284
|
-
template <typename T>
|
285
|
-
using GetSizeType = typename T::size_type;
|
286
|
-
|
287
|
-
template <typename T>
|
288
|
-
using GetPropagateOnContainerCopyAssignment =
|
289
|
-
typename T::propagate_on_container_copy_assignment;
|
290
|
-
|
291
|
-
template <typename T>
|
292
|
-
using GetPropagateOnContainerMoveAssignment =
|
293
|
-
typename T::propagate_on_container_move_assignment;
|
294
|
-
|
295
|
-
template <typename T>
|
296
|
-
using GetPropagateOnContainerSwap = typename T::propagate_on_container_swap;
|
297
|
-
|
298
|
-
template <typename T>
|
299
|
-
using GetIsAlwaysEqual = typename T::is_always_equal;
|
300
|
-
|
301
|
-
template <typename T>
|
302
|
-
struct GetFirstArg;
|
303
|
-
|
304
|
-
template <template <typename...> class Class, typename T, typename... Args>
|
305
|
-
struct GetFirstArg<Class<T, Args...>> {
|
306
|
-
using type = T;
|
307
|
-
};
|
308
|
-
|
309
|
-
template <typename Ptr, typename = void>
|
310
|
-
struct ElementType {
|
311
|
-
using type = typename GetFirstArg<Ptr>::type;
|
312
|
-
};
|
313
|
-
|
314
|
-
template <typename T>
|
315
|
-
struct ElementType<T, void_t<typename T::element_type>> {
|
316
|
-
using type = typename T::element_type;
|
317
|
-
};
|
318
|
-
|
319
|
-
template <typename T, typename U>
|
320
|
-
struct RebindFirstArg;
|
321
|
-
|
322
|
-
template <template <typename...> class Class, typename T, typename... Args,
|
323
|
-
typename U>
|
324
|
-
struct RebindFirstArg<Class<T, Args...>, U> {
|
325
|
-
using type = Class<U, Args...>;
|
326
|
-
};
|
327
|
-
|
328
|
-
template <typename T, typename U, typename = void>
|
329
|
-
struct RebindPtr {
|
330
|
-
using type = typename RebindFirstArg<T, U>::type;
|
331
|
-
};
|
332
|
-
|
333
|
-
template <typename T, typename U>
|
334
|
-
struct RebindPtr<T, U, void_t<typename T::template rebind<U>>> {
|
335
|
-
using type = typename T::template rebind<U>;
|
336
|
-
};
|
337
|
-
|
338
|
-
template <typename T, typename U>
|
339
|
-
constexpr bool HasRebindAlloc(...) {
|
340
|
-
return false;
|
341
|
-
}
|
342
|
-
|
343
|
-
template <typename T, typename U>
|
344
|
-
constexpr bool HasRebindAlloc(typename T::template rebind<U>::other*) {
|
345
|
-
return true;
|
346
|
-
}
|
347
|
-
|
348
|
-
template <typename T, typename U, bool = HasRebindAlloc<T, U>(nullptr)>
|
349
|
-
struct RebindAlloc {
|
350
|
-
using type = typename RebindFirstArg<T, U>::type;
|
351
|
-
};
|
352
|
-
|
353
|
-
template <typename T, typename U>
|
354
|
-
struct RebindAlloc<T, U, true> {
|
355
|
-
using type = typename T::template rebind<U>::other;
|
356
|
-
};
|
357
|
-
|
358
|
-
} // namespace memory_internal
|
359
|
-
|
360
|
-
// -----------------------------------------------------------------------------
|
361
|
-
// Class Template: pointer_traits
|
362
|
-
// -----------------------------------------------------------------------------
|
363
|
-
//
|
364
|
-
// An implementation of C++11's std::pointer_traits.
|
365
|
-
//
|
366
|
-
// Provided for portability on toolchains that have a working C++11 compiler,
|
367
|
-
// but the standard library is lacking in C++11 support. For example, some
|
368
|
-
// version of the Android NDK.
|
369
|
-
//
|
370
|
-
|
371
|
-
template <typename Ptr>
|
372
|
-
struct pointer_traits {
|
373
|
-
using pointer = Ptr;
|
374
|
-
|
375
|
-
// element_type:
|
376
|
-
// Ptr::element_type if present. Otherwise T if Ptr is a template
|
377
|
-
// instantiation Template<T, Args...>
|
378
|
-
using element_type = typename memory_internal::ElementType<Ptr>::type;
|
379
|
-
|
380
|
-
// difference_type:
|
381
|
-
// Ptr::difference_type if present, otherwise std::ptrdiff_t
|
382
|
-
using difference_type =
|
383
|
-
memory_internal::ExtractOrT<memory_internal::GetDifferenceType, Ptr,
|
384
|
-
std::ptrdiff_t>;
|
385
|
-
|
386
|
-
// rebind:
|
387
|
-
// Ptr::rebind<U> if exists, otherwise Template<U, Args...> if Ptr is a
|
388
|
-
// template instantiation Template<T, Args...>
|
389
|
-
template <typename U>
|
390
|
-
using rebind = typename memory_internal::RebindPtr<Ptr, U>::type;
|
391
|
-
|
392
|
-
// pointer_to:
|
393
|
-
// Calls Ptr::pointer_to(r)
|
394
|
-
static pointer pointer_to(element_type& r) { // NOLINT(runtime/references)
|
395
|
-
return Ptr::pointer_to(r);
|
396
|
-
}
|
397
|
-
};
|
398
|
-
|
399
|
-
// Specialization for T*.
|
400
|
-
template <typename T>
|
401
|
-
struct pointer_traits<T*> {
|
402
|
-
using pointer = T*;
|
403
|
-
using element_type = T;
|
404
|
-
using difference_type = std::ptrdiff_t;
|
405
|
-
|
406
|
-
template <typename U>
|
407
|
-
using rebind = U*;
|
408
|
-
|
409
|
-
// pointer_to:
|
410
|
-
// Calls std::addressof(r)
|
411
|
-
static pointer pointer_to(
|
412
|
-
element_type& r) noexcept { // NOLINT(runtime/references)
|
413
|
-
return std::addressof(r);
|
414
|
-
}
|
415
|
-
};
|
416
|
-
|
417
|
-
// -----------------------------------------------------------------------------
|
418
|
-
// Class Template: allocator_traits
|
419
|
-
// -----------------------------------------------------------------------------
|
420
|
-
//
|
421
|
-
// A C++11 compatible implementation of C++17's std::allocator_traits.
|
422
|
-
//
|
423
|
-
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
424
|
-
using std::allocator_traits;
|
425
|
-
#else // __cplusplus >= 201703L
|
426
|
-
template <typename Alloc>
|
427
|
-
struct allocator_traits {
|
428
|
-
using allocator_type = Alloc;
|
429
|
-
|
430
|
-
// value_type:
|
431
|
-
// Alloc::value_type
|
432
|
-
using value_type = typename Alloc::value_type;
|
433
|
-
|
434
|
-
// pointer:
|
435
|
-
// Alloc::pointer if present, otherwise value_type*
|
436
|
-
using pointer = memory_internal::ExtractOrT<memory_internal::GetPointer,
|
437
|
-
Alloc, value_type*>;
|
438
|
-
|
439
|
-
// const_pointer:
|
440
|
-
// Alloc::const_pointer if present, otherwise
|
441
|
-
// absl::pointer_traits<pointer>::rebind<const value_type>
|
442
|
-
using const_pointer =
|
443
|
-
memory_internal::ExtractOrT<memory_internal::GetConstPointer, Alloc,
|
444
|
-
typename absl::pointer_traits<pointer>::
|
445
|
-
template rebind<const value_type>>;
|
446
|
-
|
447
|
-
// void_pointer:
|
448
|
-
// Alloc::void_pointer if present, otherwise
|
449
|
-
// absl::pointer_traits<pointer>::rebind<void>
|
450
|
-
using void_pointer = memory_internal::ExtractOrT<
|
451
|
-
memory_internal::GetVoidPointer, Alloc,
|
452
|
-
typename absl::pointer_traits<pointer>::template rebind<void>>;
|
453
|
-
|
454
|
-
// const_void_pointer:
|
455
|
-
// Alloc::const_void_pointer if present, otherwise
|
456
|
-
// absl::pointer_traits<pointer>::rebind<const void>
|
457
|
-
using const_void_pointer = memory_internal::ExtractOrT<
|
458
|
-
memory_internal::GetConstVoidPointer, Alloc,
|
459
|
-
typename absl::pointer_traits<pointer>::template rebind<const void>>;
|
460
|
-
|
461
|
-
// difference_type:
|
462
|
-
// Alloc::difference_type if present, otherwise
|
463
|
-
// absl::pointer_traits<pointer>::difference_type
|
464
|
-
using difference_type = memory_internal::ExtractOrT<
|
465
|
-
memory_internal::GetDifferenceType, Alloc,
|
466
|
-
typename absl::pointer_traits<pointer>::difference_type>;
|
467
|
-
|
468
|
-
// size_type:
|
469
|
-
// Alloc::size_type if present, otherwise
|
470
|
-
// std::make_unsigned<difference_type>::type
|
471
|
-
using size_type = memory_internal::ExtractOrT<
|
472
|
-
memory_internal::GetSizeType, Alloc,
|
473
|
-
typename std::make_unsigned<difference_type>::type>;
|
474
|
-
|
475
|
-
// propagate_on_container_copy_assignment:
|
476
|
-
// Alloc::propagate_on_container_copy_assignment if present, otherwise
|
477
|
-
// std::false_type
|
478
|
-
using propagate_on_container_copy_assignment = memory_internal::ExtractOrT<
|
479
|
-
memory_internal::GetPropagateOnContainerCopyAssignment, Alloc,
|
480
|
-
std::false_type>;
|
481
|
-
|
482
|
-
// propagate_on_container_move_assignment:
|
483
|
-
// Alloc::propagate_on_container_move_assignment if present, otherwise
|
484
|
-
// std::false_type
|
485
|
-
using propagate_on_container_move_assignment = memory_internal::ExtractOrT<
|
486
|
-
memory_internal::GetPropagateOnContainerMoveAssignment, Alloc,
|
487
|
-
std::false_type>;
|
488
|
-
|
489
|
-
// propagate_on_container_swap:
|
490
|
-
// Alloc::propagate_on_container_swap if present, otherwise std::false_type
|
491
|
-
using propagate_on_container_swap =
|
492
|
-
memory_internal::ExtractOrT<memory_internal::GetPropagateOnContainerSwap,
|
493
|
-
Alloc, std::false_type>;
|
494
|
-
|
495
|
-
// is_always_equal:
|
496
|
-
// Alloc::is_always_equal if present, otherwise std::is_empty<Alloc>::type
|
497
|
-
using is_always_equal =
|
498
|
-
memory_internal::ExtractOrT<memory_internal::GetIsAlwaysEqual, Alloc,
|
499
|
-
typename std::is_empty<Alloc>::type>;
|
500
|
-
|
501
|
-
// rebind_alloc:
|
502
|
-
// Alloc::rebind<T>::other if present, otherwise Alloc<T, Args> if this Alloc
|
503
|
-
// is Alloc<U, Args>
|
504
|
-
template <typename T>
|
505
|
-
using rebind_alloc = typename memory_internal::RebindAlloc<Alloc, T>::type;
|
506
|
-
|
507
|
-
// rebind_traits:
|
508
|
-
// absl::allocator_traits<rebind_alloc<T>>
|
509
|
-
template <typename T>
|
510
|
-
using rebind_traits = absl::allocator_traits<rebind_alloc<T>>;
|
511
|
-
|
512
|
-
// allocate(Alloc& a, size_type n):
|
513
|
-
// Calls a.allocate(n)
|
514
|
-
static pointer allocate(Alloc& a, // NOLINT(runtime/references)
|
515
|
-
size_type n) {
|
516
|
-
return a.allocate(n);
|
517
|
-
}
|
518
|
-
|
519
|
-
// allocate(Alloc& a, size_type n, const_void_pointer hint):
|
520
|
-
// Calls a.allocate(n, hint) if possible.
|
521
|
-
// If not possible, calls a.allocate(n)
|
522
|
-
static pointer allocate(Alloc& a, size_type n, // NOLINT(runtime/references)
|
523
|
-
const_void_pointer hint) {
|
524
|
-
return allocate_impl(0, a, n, hint);
|
525
|
-
}
|
526
|
-
|
527
|
-
// deallocate(Alloc& a, pointer p, size_type n):
|
528
|
-
// Calls a.deallocate(p, n)
|
529
|
-
static void deallocate(Alloc& a, pointer p, // NOLINT(runtime/references)
|
530
|
-
size_type n) {
|
531
|
-
a.deallocate(p, n);
|
532
|
-
}
|
533
|
-
|
534
|
-
// construct(Alloc& a, T* p, Args&&... args):
|
535
|
-
// Calls a.construct(p, std::forward<Args>(args)...) if possible.
|
536
|
-
// If not possible, calls
|
537
|
-
// ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)
|
538
|
-
template <typename T, typename... Args>
|
539
|
-
static void construct(Alloc& a, T* p, // NOLINT(runtime/references)
|
540
|
-
Args&&... args) {
|
541
|
-
construct_impl(0, a, p, std::forward<Args>(args)...);
|
542
|
-
}
|
543
|
-
|
544
|
-
// destroy(Alloc& a, T* p):
|
545
|
-
// Calls a.destroy(p) if possible. If not possible, calls p->~T().
|
546
|
-
template <typename T>
|
547
|
-
static void destroy(Alloc& a, T* p) { // NOLINT(runtime/references)
|
548
|
-
destroy_impl(0, a, p);
|
549
|
-
}
|
550
|
-
|
551
|
-
// max_size(const Alloc& a):
|
552
|
-
// Returns a.max_size() if possible. If not possible, returns
|
553
|
-
// std::numeric_limits<size_type>::max() / sizeof(value_type)
|
554
|
-
static size_type max_size(const Alloc& a) { return max_size_impl(0, a); }
|
555
|
-
|
556
|
-
// select_on_container_copy_construction(const Alloc& a):
|
557
|
-
// Returns a.select_on_container_copy_construction() if possible.
|
558
|
-
// If not possible, returns a.
|
559
|
-
static Alloc select_on_container_copy_construction(const Alloc& a) {
|
560
|
-
return select_on_container_copy_construction_impl(0, a);
|
561
|
-
}
|
562
|
-
|
563
|
-
private:
|
564
|
-
template <typename A>
|
565
|
-
static auto allocate_impl(int, A& a, // NOLINT(runtime/references)
|
566
|
-
size_type n, const_void_pointer hint)
|
567
|
-
-> decltype(a.allocate(n, hint)) {
|
568
|
-
return a.allocate(n, hint);
|
569
|
-
}
|
570
|
-
static pointer allocate_impl(char, Alloc& a, // NOLINT(runtime/references)
|
571
|
-
size_type n, const_void_pointer) {
|
572
|
-
return a.allocate(n);
|
573
|
-
}
|
574
|
-
|
575
|
-
template <typename A, typename... Args>
|
576
|
-
static auto construct_impl(int, A& a, // NOLINT(runtime/references)
|
577
|
-
Args&&... args)
|
578
|
-
-> decltype(a.construct(std::forward<Args>(args)...)) {
|
579
|
-
a.construct(std::forward<Args>(args)...);
|
580
|
-
}
|
581
|
-
|
582
|
-
template <typename T, typename... Args>
|
583
|
-
static void construct_impl(char, Alloc&, T* p, Args&&... args) {
|
584
|
-
::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
|
585
|
-
}
|
586
|
-
|
587
|
-
template <typename A, typename T>
|
588
|
-
static auto destroy_impl(int, A& a, // NOLINT(runtime/references)
|
589
|
-
T* p) -> decltype(a.destroy(p)) {
|
590
|
-
a.destroy(p);
|
591
|
-
}
|
592
|
-
template <typename T>
|
593
|
-
static void destroy_impl(char, Alloc&, T* p) {
|
594
|
-
p->~T();
|
595
|
-
}
|
596
|
-
|
597
|
-
template <typename A>
|
598
|
-
static auto max_size_impl(int, const A& a) -> decltype(a.max_size()) {
|
599
|
-
return a.max_size();
|
600
|
-
}
|
601
|
-
static size_type max_size_impl(char, const Alloc&) {
|
602
|
-
return (std::numeric_limits<size_type>::max)() / sizeof(value_type);
|
603
|
-
}
|
604
|
-
|
605
|
-
template <typename A>
|
606
|
-
static auto select_on_container_copy_construction_impl(int, const A& a)
|
607
|
-
-> decltype(a.select_on_container_copy_construction()) {
|
608
|
-
return a.select_on_container_copy_construction();
|
609
|
-
}
|
610
|
-
static Alloc select_on_container_copy_construction_impl(char,
|
611
|
-
const Alloc& a) {
|
612
|
-
return a;
|
613
|
-
}
|
614
|
-
};
|
615
|
-
#endif // __cplusplus >= 201703L
|
616
|
-
|
617
|
-
namespace memory_internal {
|
618
|
-
|
619
198
|
// This template alias transforms Alloc::is_nothrow into a metafunction with
|
620
199
|
// Alloc as a parameter so it can be used with ExtractOrT<>.
|
621
200
|
template <typename Alloc>
|
@@ -114,18 +114,6 @@ struct VoidTImpl {
|
|
114
114
|
using type = void;
|
115
115
|
};
|
116
116
|
|
117
|
-
// This trick to retrieve a default alignment is necessary for our
|
118
|
-
// implementation of aligned_storage_t to be consistent with any implementation
|
119
|
-
// of std::aligned_storage.
|
120
|
-
template <size_t Len, typename T = std::aligned_storage<Len>>
|
121
|
-
struct default_alignment_of_aligned_storage;
|
122
|
-
|
123
|
-
template <size_t Len, size_t Align>
|
124
|
-
struct default_alignment_of_aligned_storage<Len,
|
125
|
-
std::aligned_storage<Len, Align>> {
|
126
|
-
static constexpr size_t value = Align;
|
127
|
-
};
|
128
|
-
|
129
117
|
////////////////////////////////
|
130
118
|
// Library Fundamentals V2 TS //
|
131
119
|
////////////////////////////////
|
@@ -298,8 +286,12 @@ struct is_function
|
|
298
286
|
// https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html#Type-Traits.
|
299
287
|
template <typename T>
|
300
288
|
struct is_trivially_destructible
|
289
|
+
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE
|
290
|
+
: std::is_trivially_destructible<T> {
|
291
|
+
#else
|
301
292
|
: std::integral_constant<bool, __has_trivial_destructor(T) &&
|
302
293
|
std::is_destructible<T>::value> {
|
294
|
+
#endif
|
303
295
|
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE
|
304
296
|
private:
|
305
297
|
static constexpr bool compliant = std::is_trivially_destructible<T>::value ==
|
@@ -347,9 +339,13 @@ struct is_trivially_destructible
|
|
347
339
|
// Nontrivially destructible types will cause the expression to be nontrivial.
|
348
340
|
template <typename T>
|
349
341
|
struct is_trivially_default_constructible
|
342
|
+
#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE)
|
343
|
+
: std::is_trivially_default_constructible<T> {
|
344
|
+
#else
|
350
345
|
: std::integral_constant<bool, __has_trivial_constructor(T) &&
|
351
346
|
std::is_default_constructible<T>::value &&
|
352
347
|
is_trivially_destructible<T>::value> {
|
348
|
+
#endif
|
353
349
|
#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE) && \
|
354
350
|
!defined( \
|
355
351
|
ABSL_META_INTERNAL_STD_CONSTRUCTION_TRAITS_DONT_CHECK_DESTRUCTION)
|
@@ -381,10 +377,14 @@ struct is_trivially_default_constructible
|
|
381
377
|
// expression to be nontrivial.
|
382
378
|
template <typename T>
|
383
379
|
struct is_trivially_move_constructible
|
380
|
+
#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE)
|
381
|
+
: std::is_trivially_move_constructible<T> {
|
382
|
+
#else
|
384
383
|
: std::conditional<
|
385
384
|
std::is_object<T>::value && !std::is_array<T>::value,
|
386
385
|
type_traits_internal::IsTriviallyMoveConstructibleObject<T>,
|
387
386
|
std::is_reference<T>>::type::type {
|
387
|
+
#endif
|
388
388
|
#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE) && \
|
389
389
|
!defined( \
|
390
390
|
ABSL_META_INTERNAL_STD_CONSTRUCTION_TRAITS_DONT_CHECK_DESTRUCTION)
|
@@ -490,9 +490,13 @@ struct is_trivially_move_assignable
|
|
490
490
|
// `is_trivially_assignable<T&, const T&>`.
|
491
491
|
template <typename T>
|
492
492
|
struct is_trivially_copy_assignable
|
493
|
+
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
|
494
|
+
: std::is_trivially_copy_assignable<T> {
|
495
|
+
#else
|
493
496
|
: std::integral_constant<
|
494
497
|
bool, __has_trivial_assign(typename std::remove_reference<T>::type) &&
|
495
498
|
absl::is_copy_assignable<T>::value> {
|
499
|
+
#endif
|
496
500
|
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
|
497
501
|
private:
|
498
502
|
static constexpr bool compliant =
|
@@ -544,6 +548,11 @@ namespace type_traits_internal {
|
|
544
548
|
// destructible. Arrays of trivially copyable types are trivially copyable.
|
545
549
|
//
|
546
550
|
// We expose this metafunction only for internal use within absl.
|
551
|
+
|
552
|
+
#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_COPYABLE)
|
553
|
+
template <typename T>
|
554
|
+
struct is_trivially_copyable : std::is_trivially_copyable<T> {};
|
555
|
+
#else
|
547
556
|
template <typename T>
|
548
557
|
class is_trivially_copyable_impl {
|
549
558
|
using ExtentsRemoved = typename std::remove_all_extents<T>::type;
|
@@ -569,6 +578,7 @@ template <typename T>
|
|
569
578
|
struct is_trivially_copyable
|
570
579
|
: std::integral_constant<
|
571
580
|
bool, type_traits_internal::is_trivially_copyable_impl<T>::kValue> {};
|
581
|
+
#endif
|
572
582
|
} // namespace type_traits_internal
|
573
583
|
|
574
584
|
// -----------------------------------------------------------------------------
|
@@ -620,6 +630,21 @@ using remove_extent_t = typename std::remove_extent<T>::type;
|
|
620
630
|
template <typename T>
|
621
631
|
using remove_all_extents_t = typename std::remove_all_extents<T>::type;
|
622
632
|
|
633
|
+
namespace type_traits_internal {
|
634
|
+
// This trick to retrieve a default alignment is necessary for our
|
635
|
+
// implementation of aligned_storage_t to be consistent with any
|
636
|
+
// implementation of std::aligned_storage.
|
637
|
+
template <size_t Len, typename T = std::aligned_storage<Len>>
|
638
|
+
struct default_alignment_of_aligned_storage;
|
639
|
+
|
640
|
+
template <size_t Len, size_t Align>
|
641
|
+
struct default_alignment_of_aligned_storage<
|
642
|
+
Len, std::aligned_storage<Len, Align>> {
|
643
|
+
static constexpr size_t value = Align;
|
644
|
+
};
|
645
|
+
} // namespace type_traits_internal
|
646
|
+
|
647
|
+
// TODO(b/260219225): std::aligned_storage(_t) is deprecated in C++23.
|
623
648
|
template <size_t Len, size_t Align = type_traits_internal::
|
624
649
|
default_alignment_of_aligned_storage<Len>::value>
|
625
650
|
using aligned_storage_t = typename std::aligned_storage<Len, Align>::type;
|
@@ -791,6 +816,73 @@ using swap_internal::Swap;
|
|
791
816
|
using swap_internal::StdSwapIsUnconstrained;
|
792
817
|
|
793
818
|
} // namespace type_traits_internal
|
819
|
+
|
820
|
+
// absl::is_trivially_relocatable<T>
|
821
|
+
// Detects whether a type is "trivially relocatable" -- meaning it can be
|
822
|
+
// relocated without invoking the constructor/destructor, using a form of move
|
823
|
+
// elision.
|
824
|
+
//
|
825
|
+
// Example:
|
826
|
+
//
|
827
|
+
// if constexpr (absl::is_trivially_relocatable<T>::value) {
|
828
|
+
// memcpy(new_location, old_location, sizeof(T));
|
829
|
+
// } else {
|
830
|
+
// new(new_location) T(std::move(*old_location));
|
831
|
+
// old_location->~T();
|
832
|
+
// }
|
833
|
+
//
|
834
|
+
// Upstream documentation:
|
835
|
+
//
|
836
|
+
// https://clang.llvm.org/docs/LanguageExtensions.html#:~:text=__is_trivially_relocatable
|
837
|
+
//
|
838
|
+
#if ABSL_HAVE_BUILTIN(__is_trivially_relocatable)
|
839
|
+
template <class T>
|
840
|
+
struct is_trivially_relocatable
|
841
|
+
: std::integral_constant<bool, __is_trivially_relocatable(T)> {};
|
842
|
+
#else
|
843
|
+
template <class T>
|
844
|
+
struct is_trivially_relocatable : std::integral_constant<bool, false> {};
|
845
|
+
#endif
|
846
|
+
|
847
|
+
// absl::is_constant_evaluated()
|
848
|
+
//
|
849
|
+
// Detects whether the function call occurs within a constant-evaluated context.
|
850
|
+
// Returns true if the evaluation of the call occurs within the evaluation of an
|
851
|
+
// expression or conversion that is manifestly constant-evaluated; otherwise
|
852
|
+
// returns false.
|
853
|
+
//
|
854
|
+
// This function is implemented in terms of `std::is_constant_evaluated` for
|
855
|
+
// c++20 and up. For older c++ versions, the function is implemented in terms
|
856
|
+
// of `__builtin_is_constant_evaluated` if available, otherwise the function
|
857
|
+
// will fail to compile.
|
858
|
+
//
|
859
|
+
// Applications can inspect `ABSL_HAVE_CONSTANT_EVALUATED` at compile time
|
860
|
+
// to check if this function is supported.
|
861
|
+
//
|
862
|
+
// Example:
|
863
|
+
//
|
864
|
+
// constexpr MyClass::MyClass(int param) {
|
865
|
+
// #ifdef ABSL_HAVE_CONSTANT_EVALUATED
|
866
|
+
// if (!absl::is_constant_evaluated()) {
|
867
|
+
// ABSL_LOG(INFO) << "MyClass(" << param << ")";
|
868
|
+
// }
|
869
|
+
// #endif // ABSL_HAVE_CONSTANT_EVALUATED
|
870
|
+
// }
|
871
|
+
//
|
872
|
+
// Upstream documentation:
|
873
|
+
//
|
874
|
+
// http://en.cppreference.com/w/cpp/types/is_constant_evaluated
|
875
|
+
// http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#:~:text=__builtin_is_constant_evaluated
|
876
|
+
//
|
877
|
+
#if defined(ABSL_HAVE_CONSTANT_EVALUATED)
|
878
|
+
constexpr bool is_constant_evaluated() noexcept {
|
879
|
+
#ifdef __cpp_lib_is_constant_evaluated
|
880
|
+
return std::is_constant_evaluated();
|
881
|
+
#elif ABSL_HAVE_BUILTIN(__builtin_is_constant_evaluated)
|
882
|
+
return __builtin_is_constant_evaluated();
|
883
|
+
#endif
|
884
|
+
}
|
885
|
+
#endif // ABSL_HAVE_CONSTANT_EVALUATED
|
794
886
|
ABSL_NAMESPACE_END
|
795
887
|
} // namespace absl
|
796
888
|
|