grpc 1.71.0 → 1.72.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 +78 -75
- data/include/grpc/event_engine/memory_request.h +3 -3
- data/include/grpc/impl/channel_arg_names.h +70 -50
- data/include/grpc/support/workaround_list.h +1 -4
- data/src/core/{lib/transport → call}/call_arena_allocator.cc +1 -1
- data/src/core/{lib/transport → call}/call_arena_allocator.h +3 -3
- data/src/core/{lib/transport → call}/call_destination.h +4 -4
- data/src/core/{lib/transport → call}/call_filters.cc +2 -2
- data/src/core/{lib/transport → call}/call_filters.h +25 -6
- data/src/core/{lib/channel → call}/call_finalization.h +3 -3
- data/src/core/{lib/transport → call}/call_spine.cc +1 -1
- data/src/core/{lib/transport → call}/call_spine.h +68 -26
- data/src/core/{lib/transport → call}/call_state.cc +1 -1
- data/src/core/{lib/transport → call}/call_state.h +3 -3
- data/src/core/{lib/surface → call}/client_call.cc +9 -7
- data/src/core/{lib/surface → call}/client_call.h +4 -4
- data/src/core/{lib/transport → call}/custom_metadata.h +3 -3
- data/src/core/{lib/transport → call}/interception_chain.cc +5 -5
- data/src/core/{lib/transport → call}/interception_chain.h +7 -7
- data/src/core/{lib/transport → call}/message.cc +1 -1
- data/src/core/{lib/transport → call}/message.h +7 -3
- data/src/core/{lib/transport → call}/metadata.cc +2 -2
- data/src/core/{lib/transport → call}/metadata.h +4 -4
- data/src/core/{lib/transport → call}/metadata_batch.cc +1 -1
- data/src/core/{lib/transport → call}/metadata_batch.h +7 -7
- data/src/core/{lib/transport → call}/metadata_compression_traits.h +3 -3
- data/src/core/{lib/transport → call}/metadata_info.cc +27 -9
- data/src/core/{lib/transport → call}/metadata_info.h +4 -4
- data/src/core/{lib/transport → call}/parsed_metadata.cc +1 -1
- data/src/core/{lib/transport → call}/parsed_metadata.h +3 -3
- data/src/core/call/request_buffer.h +3 -3
- data/src/core/call/security_context.cc +125 -0
- data/src/core/call/security_context.h +114 -0
- data/src/core/{lib/surface → call}/server_call.cc +3 -3
- data/src/core/{lib/surface → call}/server_call.h +5 -5
- data/src/core/{lib/transport → call}/simple_slice_based_metadata.h +4 -4
- data/src/core/{lib/channel → call}/status_util.cc +1 -1
- data/src/core/{lib/channel → call}/status_util.h +3 -3
- data/src/core/client_channel/client_channel.cc +24 -16
- data/src/core/client_channel/client_channel.h +4 -3
- data/src/core/client_channel/client_channel_filter.cc +10 -20
- data/src/core/client_channel/client_channel_filter.h +1 -1
- data/src/core/client_channel/client_channel_internal.h +1 -1
- data/src/core/client_channel/config_selector.h +2 -2
- data/src/core/client_channel/direct_channel.cc +2 -2
- data/src/core/client_channel/dynamic_filters.cc +0 -1
- data/src/core/client_channel/dynamic_filters.h +0 -1
- data/src/core/client_channel/lb_metadata.h +1 -1
- data/src/core/client_channel/load_balanced_call_destination.cc +1 -1
- data/src/core/client_channel/load_balanced_call_destination.h +1 -1
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +43 -41
- data/src/core/client_channel/retry_filter_legacy_call_data.h +6 -6
- data/src/core/client_channel/retry_interceptor.h +1 -1
- data/src/core/client_channel/retry_service_config.cc +1 -1
- data/src/core/client_channel/retry_service_config.h +1 -1
- data/src/core/client_channel/retry_throttle.cc +30 -34
- data/src/core/client_channel/retry_throttle.h +10 -2
- data/src/core/client_channel/subchannel.cc +7 -8
- data/src/core/client_channel/subchannel.h +1 -2
- data/src/core/client_channel/subchannel_stream_client.cc +14 -11
- data/src/core/client_channel/subchannel_stream_client.h +2 -2
- data/src/core/config/core_configuration.h +2 -2
- data/src/core/credentials/call/call_credentials.h +157 -0
- data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.h +4 -4
- data/src/core/{lib/security/credentials/composite/composite_credentials.cc → credentials/call/composite/composite_call_credentials.cc} +4 -57
- data/src/core/credentials/call/composite/composite_call_credentials.h +82 -0
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.cc +6 -6
- data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.h +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.h +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.h +6 -6
- data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.h +4 -4
- data/src/core/{lib/security/util → credentials/call}/json_util.cc +1 -1
- data/src/core/{lib/security/util → credentials/call}/json_util.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.cc +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.cc +4 -3
- data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_linux.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_no_op.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_windows.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_client_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_server_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry_init.cc +21 -17
- data/src/core/credentials/transport/composite/composite_channel_credentials.cc +68 -0
- data/src/core/{lib/security/credentials/composite/composite_credentials.h → credentials/transport/composite/composite_channel_credentials.h} +6 -51
- data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.cc +4 -26
- data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.h +5 -37
- data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/credentials_generic.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.cc +31 -19
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.h +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.h +6 -6
- data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.cc +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.h +4 -4
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_factory.h +3 -3
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.cc +1 -1
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_match.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.h +7 -7
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_fallback.cc +1 -1
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_windows.cc +1 -1
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.cc +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.cc +6 -6
- data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.h +6 -6
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.h +3 -3
- data/src/core/{lib/security/credentials/credentials.cc → credentials/transport/transport_credentials.cc} +1 -3
- data/src/core/{lib/security/credentials/credentials.h → credentials/transport/transport_credentials.h} +5 -121
- data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.cc +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.h +6 -6
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +8 -5
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +2 -2
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +1 -1
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +2 -2
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.h +1 -1
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -2
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.h +1 -1
- data/src/core/ext/filters/http/server/http_server_filter.cc +1 -1
- data/src/core/ext/filters/message_size/message_size_filter.cc +1 -1
- data/src/core/ext/filters/rbac/rbac_filter.cc +2 -2
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +1 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +58 -57
- data/src/core/ext/transport/chttp2/transport/context_list_entry.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.cc +89 -68
- data/src/core/ext/transport/chttp2/transport/frame.h +37 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +6 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +10 -8
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_status.h +52 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +11 -14
- data/src/core/ext/transport/chttp2/transport/parsing.cc +36 -23
- data/src/core/ext/transport/chttp2/transport/writing.cc +15 -14
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +65 -65
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +28 -28
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +14 -14
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +6 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +133 -133
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +71 -71
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +26 -26
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +7 -7
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +216 -218
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +66 -66
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +27 -27
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +326 -328
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +103 -103
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +58 -58
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +14 -14
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +22 -24
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +29 -29
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +186 -192
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +54 -54
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +54 -54
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +21 -21
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +59 -61
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +15 -15
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +100 -100
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +34 -34
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +12 -12
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +5 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +118 -118
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +39 -39
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +19 -19
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +27 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +12 -14
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +41 -41
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +24 -24
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +139 -139
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +46 -46
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +61 -61
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +20 -20
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +33 -33
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +14 -14
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +12 -14
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +52 -54
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +620 -626
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +215 -215
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +13 -13
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +15 -15
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +16 -16
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +306 -312
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +96 -96
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +61 -61
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +27 -27
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +19 -19
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +6 -6
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +25 -25
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +34 -34
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +294 -294
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +105 -105
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +23 -23
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +84 -84
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +28 -28
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +87 -87
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +31 -31
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +24 -24
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +5 -5
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +130 -132
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +43 -43
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +60 -60
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +26 -26
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +11 -11
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +85 -89
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +20 -20
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +80 -83
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +27 -27
- data/src/core/ext/upb-gen/google/api/http.upb.h +51 -51
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +22 -22
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +327 -301
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +97 -85
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +9 -11
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +9 -10
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +110 -113
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +25 -25
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +6 -6
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +21 -22
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +70 -72
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +17 -17
- data/src/core/ext/upb-gen/validate/validate.upb.h +368 -368
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +117 -117
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +9 -10
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +7 -7
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +12 -12
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +27 -30
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +7 -7
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +3 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +22 -24
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +3 -3
- data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +98 -87
- data/src/core/{lib/security/transport → filter/auth}/auth_filters.h +8 -7
- data/src/core/{lib/security/transport → filter/auth}/client_auth_filter.cc +7 -6
- data/src/core/{lib/security/transport → filter/auth}/server_auth_filter.cc +5 -4
- data/src/core/handshaker/handshaker.cc +0 -8
- data/src/core/handshaker/security/security_handshaker.cc +1 -1
- data/src/core/handshaker/security/security_handshaker.h +1 -1
- data/src/core/lib/channel/channel_args.h +49 -30
- data/src/core/lib/channel/channel_stack.h +1 -2
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/connected_channel.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.h +3 -3
- data/src/core/lib/debug/trace_flags.cc +2 -4
- data/src/core/lib/debug/trace_flags.h +1 -2
- data/src/core/lib/event_engine/default_event_engine_factory.cc +6 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +1 -1
- data/src/core/lib/event_engine/extensions/iomgr_compatible.h +39 -0
- data/src/core/lib/event_engine/extensions/supports_win_sockets.h +48 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +0 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +26 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +4 -0
- data/src/core/lib/event_engine/posix_engine/set_socket_dualstack.cc +64 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +0 -11
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +10 -2
- data/src/core/lib/event_engine/shim.cc +9 -16
- data/src/core/lib/event_engine/shim.h +11 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +15 -7
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +2 -1
- data/src/core/lib/event_engine/windows/win_socket.cc +11 -0
- data/src/core/lib/event_engine/windows/win_socket.h +3 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +5 -10
- data/src/core/lib/event_engine/windows/windows_engine.cc +42 -0
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -2
- data/src/core/lib/event_engine/windows/windows_listener.cc +5 -6
- data/src/core/lib/event_engine/windows/windows_listener.h +9 -4
- data/src/core/lib/experiments/experiments.cc +174 -21
- data/src/core/lib/experiments/experiments.h +70 -13
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +43 -16
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +43 -8
- data/src/core/lib/iomgr/error.cc +27 -43
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +13 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +13 -0
- data/src/core/lib/iomgr/polling_entity.cc +2 -7
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
- data/src/core/lib/iomgr/socket_utils_posix.cc +22 -11
- data/src/core/lib/iomgr/socket_utils_posix.h +12 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +8 -9
- data/src/core/lib/iomgr/tcp_client_posix.cc +11 -15
- data/src/core/lib/iomgr/tcp_client_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +58 -31
- data/src/core/lib/iomgr/tcp_posix.h +10 -2
- data/src/core/lib/iomgr/tcp_server_posix.cc +9 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +27 -16
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -2
- data/src/core/lib/promise/all_ok.h +31 -0
- data/src/core/lib/promise/loop.h +8 -5
- data/src/core/lib/promise/map.h +65 -2
- data/src/core/lib/promise/party.h +5 -1
- data/src/core/lib/promise/poll.h +22 -20
- data/src/core/lib/promise/promise.h +2 -2
- data/src/core/lib/promise/status_flag.h +23 -11
- data/src/core/lib/security/authorization/evaluate_args.cc +1 -1
- data/src/core/lib/security/authorization/evaluate_args.h +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -1
- data/src/core/lib/slice/slice.h +6 -0
- data/src/core/lib/surface/call.cc +20 -18
- data/src/core/lib/surface/call_utils.cc +3 -3
- data/src/core/lib/surface/call_utils.h +3 -3
- data/src/core/lib/surface/channel.h +2 -2
- data/src/core/lib/surface/channel_init.h +2 -2
- data/src/core/lib/surface/completion_queue.cc +77 -17
- data/src/core/lib/surface/filter_stack_call.cc +40 -27
- data/src/core/lib/surface/filter_stack_call.h +1 -1
- data/src/core/lib/surface/init.cc +2 -3
- data/src/core/lib/surface/lame_client.cc +1 -1
- data/src/core/lib/surface/legacy_channel.cc +27 -23
- data/src/core/lib/surface/legacy_channel.h +1 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/error_utils.cc +65 -11
- data/src/core/lib/transport/error_utils.h +2 -2
- data/src/core/lib/transport/status_conversion.cc +16 -14
- data/src/core/lib/transport/status_conversion.h +5 -4
- data/src/core/lib/transport/transport.h +5 -5
- data/src/core/lib/transport/transport_op_string.cc +1 -1
- data/src/core/load_balancing/delegating_helper.h +1 -1
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +1 -1
- data/src/core/load_balancing/grpclb/grpclb.cc +1 -2
- data/src/core/load_balancing/pick_first/pick_first.cc +0 -955
- data/src/core/load_balancing/rls/rls.cc +31 -37
- data/src/core/load_balancing/weighted_target/weighted_target.cc +1 -1
- data/src/core/load_balancing/xds/cds.cc +3 -10
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +1 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -0
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -2
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +1 -3
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -0
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +1 -1
- data/src/core/resolver/xds/xds_dependency_manager.cc +8 -3
- data/src/core/resolver/xds/xds_resolver.cc +2 -2
- data/src/core/server/server.cc +7 -4
- data/src/core/server/server.h +1 -1
- data/src/core/server/server_call_tracer_filter.cc +1 -1
- data/src/core/server/server_config_selector.h +1 -1
- data/src/core/server/server_config_selector_filter.cc +1 -1
- data/src/core/server/xds_server_config_fetcher.cc +5 -5
- data/src/core/service_config/service_config_channel_arg_filter.cc +1 -1
- data/src/core/telemetry/call_tracer.cc +2 -4
- data/src/core/telemetry/call_tracer.h +3 -3
- data/src/core/telemetry/metrics.cc +30 -12
- data/src/core/telemetry/metrics.h +15 -3
- data/src/core/telemetry/stats_data.cc +75 -2
- data/src/core/telemetry/stats_data.h +46 -4
- data/src/core/telemetry/tcp_tracer.h +90 -84
- data/src/core/{lib/security/context/security_context.cc → transport/auth_context.cc} +1 -96
- data/src/core/{lib/security/context/security_context.h → transport/auth_context.h} +6 -76
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
- data/src/core/tsi/ssl_transport_security.cc +1 -1
- data/src/core/util/check_class_size.h +48 -0
- data/src/core/util/gcp_metadata_query.cc +1 -1
- data/src/core/util/http_client/httpcli.cc +3 -3
- data/src/core/util/http_client/httpcli_security_connector.cc +3 -3
- data/src/core/util/load_file.cc +26 -14
- data/src/core/util/status_helper.cc +86 -63
- data/src/core/util/status_helper.h +9 -26
- data/src/core/xds/grpc/certificate_provider_store.cc +1 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +1 -1
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +10 -7
- data/src/core/xds/grpc/xds_certificate_provider.cc +1 -1
- data/src/core/xds/grpc/xds_certificate_provider.h +2 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +7 -6
- data/src/core/xds/grpc/xds_client_grpc.h +4 -2
- data/src/core/xds/grpc/xds_cluster.h +3 -3
- data/src/core/xds/grpc/xds_cluster_parser.cc +3 -2
- data/src/core/xds/grpc/xds_http_fault_filter.cc +1 -1
- data/src/core/xds/grpc/xds_http_filter.h +1 -1
- data/src/core/xds/grpc/xds_http_filter_registry.h +1 -1
- data/src/core/xds/grpc/xds_route_config.h +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.h +1 -1
- data/src/core/xds/grpc/xds_routing.h +1 -1
- data/src/core/xds/grpc/xds_server_grpc.cc +60 -48
- data/src/core/xds/grpc/xds_server_grpc.h +23 -13
- data/src/core/xds/grpc/xds_server_grpc_interface.h +2 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +5 -5
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -3
- data/src/core/xds/xds_client/lrs_client.cc +6 -5
- data/src/core/xds/xds_client/lrs_client.h +7 -7
- data/src/core/xds/xds_client/xds_bootstrap.h +16 -1
- data/src/core/xds/xds_client/xds_client.cc +25 -23
- data/src/core/xds/xds_client/xds_client.h +3 -1
- data/src/core/xds/xds_client/xds_resource_type.h +1 -2
- data/src/core/xds/xds_client/xds_transport.h +1 -1
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.cc +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.cc +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/crypto.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +20 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -25
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +3 -7
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +13 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_credential.cc +2 -1
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +1 -1
- data/third_party/upb/upb/base/internal/log2.h +3 -1
- data/third_party/upb/upb/base/string_view.h +10 -0
- data/third_party/upb/upb/hash/common.c +5 -1
- data/third_party/upb/upb/json/decode.c +2 -2
- data/third_party/upb/upb/json/decode.h +0 -1
- data/third_party/upb/upb/mem/alloc.h +5 -0
- data/third_party/upb/upb/mem/arena.c +296 -142
- data/third_party/upb/upb/mem/arena.h +47 -11
- data/third_party/upb/upb/mem/arena.hpp +4 -20
- data/third_party/upb/upb/mem/internal/arena.h +4 -6
- data/third_party/upb/upb/message/accessors.h +41 -0
- data/third_party/upb/upb/message/compat.c +11 -14
- data/third_party/upb/upb/message/compat.h +4 -3
- data/third_party/upb/upb/message/copy.c +35 -30
- data/third_party/upb/upb/message/internal/accessors.h +139 -10
- data/third_party/upb/upb/message/internal/extension.c +28 -25
- data/third_party/upb/upb/message/internal/extension.h +21 -5
- data/third_party/upb/upb/message/internal/iterator.c +58 -0
- data/third_party/upb/upb/message/internal/iterator.h +29 -0
- data/third_party/upb/upb/message/internal/map.h +2 -3
- data/third_party/upb/upb/message/internal/map_sorter.h +3 -2
- data/third_party/upb/upb/message/internal/message.c +48 -29
- data/third_party/upb/upb/message/internal/message.h +154 -24
- data/third_party/upb/upb/message/map_sorter.c +20 -8
- data/third_party/upb/upb/message/message.c +90 -38
- data/third_party/upb/upb/message/message.h +58 -2
- data/third_party/upb/upb/message/value.h +9 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +1 -1
- data/third_party/upb/upb/mini_descriptor/decode.c +97 -136
- data/third_party/upb/upb/mini_descriptor/decode.h +4 -3
- data/third_party/upb/upb/mini_descriptor/internal/encode.hpp +1 -1
- data/third_party/upb/upb/mini_table/extension_registry.c +24 -12
- data/third_party/upb/upb/mini_table/extension_registry.h +13 -6
- data/third_party/upb/upb/mini_table/message.c +21 -13
- data/third_party/upb/upb/port/atomic.h +134 -7
- data/third_party/upb/upb/port/def.inc +140 -38
- data/third_party/upb/upb/port/undef.inc +11 -1
- data/third_party/upb/upb/reflection/def.hpp +5 -1
- data/third_party/upb/upb/reflection/def_pool.c +10 -3
- data/third_party/upb/upb/reflection/descriptor_bootstrap.h +1 -1
- data/third_party/upb/upb/reflection/file_def.c +12 -5
- data/third_party/upb/upb/reflection/internal/def_builder.c +1 -1
- data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
- data/third_party/upb/upb/reflection/message.c +19 -16
- data/third_party/upb/upb/reflection/message.h +3 -1
- data/third_party/upb/upb/text/encode.c +1 -13
- data/third_party/upb/upb/text/internal/encode.c +25 -6
- data/third_party/upb/upb/text/internal/encode.h +4 -0
- data/third_party/upb/upb/wire/decode.c +60 -45
- data/third_party/upb/upb/wire/decode.h +4 -2
- data/third_party/upb/upb/wire/encode.c +77 -42
- data/third_party/upb/upb/wire/encode.h +2 -0
- data/third_party/upb/upb/wire/eps_copy_input_stream.h +18 -20
- data/third_party/upb/upb/wire/internal/decoder.h +4 -11
- data/third_party/utf8_range/utf8_range.c +15 -275
- data/third_party/utf8_range/utf8_range_neon.inc +117 -0
- data/third_party/utf8_range/utf8_range_sse.inc +272 -0
- data/third_party/zlib/deflate.c +40 -15
- data/third_party/zlib/deflate.h +33 -2
- data/third_party/zlib/gzguts.h +2 -6
- data/third_party/zlib/inflate.c +1 -1
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/inftrees.h +2 -2
- data/third_party/zlib/trees.c +18 -4
- data/third_party/zlib/zconf.h +1 -9
- data/third_party/zlib/zlib.h +12 -12
- data/third_party/zlib/zutil.h +4 -25
- metadata +155 -145
- data/include/grpc/grpc_cronet.h +0 -37
- data/src/core/lib/transport/http2_errors.h +0 -43
- data/third_party/upb/upb/message/internal/compare_unknown.c +0 -289
- data/third_party/upb/upb/message/internal/compare_unknown.h +0 -49
@@ -21,14 +21,15 @@
|
|
21
21
|
// Must be last.
|
22
22
|
#include "upb/port/def.inc"
|
23
23
|
|
24
|
-
static UPB_ATOMIC(size_t)
|
24
|
+
static UPB_ATOMIC(size_t) g_max_block_size = UPB_DEFAULT_MAX_BLOCK_SIZE;
|
25
25
|
|
26
|
-
void upb_Arena_SetMaxBlockSize(size_t max) {
|
26
|
+
void upb_Arena_SetMaxBlockSize(size_t max) {
|
27
|
+
upb_Atomic_Store(&g_max_block_size, max, memory_order_relaxed);
|
28
|
+
}
|
27
29
|
|
28
30
|
typedef struct upb_MemBlock {
|
29
|
-
|
30
|
-
|
31
|
-
uint32_t size;
|
31
|
+
struct upb_MemBlock* next;
|
32
|
+
size_t size;
|
32
33
|
// Data follows.
|
33
34
|
} upb_MemBlock;
|
34
35
|
|
@@ -37,6 +38,10 @@ typedef struct upb_ArenaInternal {
|
|
37
38
|
// block.
|
38
39
|
uintptr_t block_alloc;
|
39
40
|
|
41
|
+
// The cleanup for the allocator. This is called after all the blocks are
|
42
|
+
// freed in an arena.
|
43
|
+
upb_AllocCleanupFunc* upb_alloc_cleanup;
|
44
|
+
|
40
45
|
// When multiple arenas are fused together, each arena points to a parent
|
41
46
|
// arena (root points to itself). The root tracks how many live arenas
|
42
47
|
// reference it.
|
@@ -50,15 +55,19 @@ typedef struct upb_ArenaInternal {
|
|
50
55
|
// == NULL at end of list.
|
51
56
|
UPB_ATOMIC(struct upb_ArenaInternal*) next;
|
52
57
|
|
53
|
-
//
|
54
|
-
//
|
55
|
-
//
|
56
|
-
// ==
|
57
|
-
UPB_ATOMIC(
|
58
|
+
// If the low bit is set, is a pointer to the tail of the list (populated for
|
59
|
+
// roots, set to self for roots with no fused arenas). If the low bit is not
|
60
|
+
// set, is a pointer to the previous node in the list, such that
|
61
|
+
// a->previous_or_tail->next == a.
|
62
|
+
UPB_ATOMIC(uintptr_t) previous_or_tail;
|
63
|
+
|
64
|
+
// Linked list of blocks to free/cleanup.
|
65
|
+
upb_MemBlock* blocks;
|
58
66
|
|
59
|
-
//
|
60
|
-
|
61
|
-
|
67
|
+
// Total space allocated in blocks, atomic only for SpaceAllocated
|
68
|
+
UPB_ATOMIC(uintptr_t) space_allocated;
|
69
|
+
|
70
|
+
UPB_TSAN_PUBLISHED_MEMBER
|
62
71
|
} upb_ArenaInternal;
|
63
72
|
|
64
73
|
// All public + private state for an arena.
|
@@ -73,7 +82,7 @@ typedef struct {
|
|
73
82
|
} upb_ArenaRoot;
|
74
83
|
|
75
84
|
static const size_t kUpb_MemblockReserve =
|
76
|
-
|
85
|
+
UPB_ALIGN_MALLOC(sizeof(upb_MemBlock));
|
77
86
|
|
78
87
|
// Extracts the (upb_ArenaInternal*) from a (upb_Arena*)
|
79
88
|
static upb_ArenaInternal* upb_Arena_Internal(const upb_Arena* a) {
|
@@ -111,6 +120,38 @@ static uintptr_t _upb_Arena_TaggedFromPointer(upb_ArenaInternal* ai) {
|
|
111
120
|
return parent_or_count;
|
112
121
|
}
|
113
122
|
|
123
|
+
static bool _upb_Arena_IsTaggedTail(uintptr_t previous_or_tail) {
|
124
|
+
return (previous_or_tail & 1) == 1;
|
125
|
+
}
|
126
|
+
|
127
|
+
static bool _upb_Arena_IsTaggedPrevious(uintptr_t previous_or_tail) {
|
128
|
+
return (previous_or_tail & 1) == 0;
|
129
|
+
}
|
130
|
+
|
131
|
+
static upb_ArenaInternal* _upb_Arena_TailFromTagged(
|
132
|
+
uintptr_t previous_or_tail) {
|
133
|
+
UPB_ASSERT(_upb_Arena_IsTaggedTail(previous_or_tail));
|
134
|
+
return (upb_ArenaInternal*)(previous_or_tail ^ 1);
|
135
|
+
}
|
136
|
+
|
137
|
+
static uintptr_t _upb_Arena_TaggedFromTail(upb_ArenaInternal* tail) {
|
138
|
+
uintptr_t previous_or_tail = (uintptr_t)tail | 1;
|
139
|
+
UPB_ASSERT(_upb_Arena_IsTaggedTail(previous_or_tail));
|
140
|
+
return previous_or_tail;
|
141
|
+
}
|
142
|
+
|
143
|
+
static upb_ArenaInternal* _upb_Arena_PreviousFromTagged(
|
144
|
+
uintptr_t previous_or_tail) {
|
145
|
+
UPB_ASSERT(_upb_Arena_IsTaggedPrevious(previous_or_tail));
|
146
|
+
return (upb_ArenaInternal*)previous_or_tail;
|
147
|
+
}
|
148
|
+
|
149
|
+
static uintptr_t _upb_Arena_TaggedFromPrevious(upb_ArenaInternal* ai) {
|
150
|
+
uintptr_t previous = (uintptr_t)ai;
|
151
|
+
UPB_ASSERT(_upb_Arena_IsTaggedPrevious(previous));
|
152
|
+
return previous;
|
153
|
+
}
|
154
|
+
|
114
155
|
static upb_alloc* _upb_ArenaInternal_BlockAlloc(upb_ArenaInternal* ai) {
|
115
156
|
return (upb_alloc*)(ai->block_alloc & ~0x1);
|
116
157
|
}
|
@@ -157,56 +198,79 @@ void upb_Arena_LogFree(const upb_Arena* arena) {
|
|
157
198
|
}
|
158
199
|
#endif // UPB_TRACING_ENABLED
|
159
200
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
201
|
+
// If the param a is already the root, provides no memory order of refcount.
|
202
|
+
// If it has a parent, then acquire memory order is provided for both the root
|
203
|
+
// and the refcount. Thread safe.
|
204
|
+
static upb_ArenaRoot _upb_Arena_FindRoot(upb_ArenaInternal* ai) {
|
205
|
+
uintptr_t poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_relaxed);
|
206
|
+
if (_upb_Arena_IsTaggedRefcount(poc)) {
|
207
|
+
// Fast, relaxed path - arenas that have never been fused to a parent only
|
208
|
+
// need relaxed memory order, since they're returning themselves and the
|
209
|
+
// refcount.
|
210
|
+
return (upb_ArenaRoot){.root = ai, .tagged_count = poc};
|
211
|
+
}
|
212
|
+
// Slow path needs acquire order; reloading is cheaper than a fence on ARM
|
213
|
+
// (LDA vs DMB ISH). Even though this is a reread, we know it must be a tagged
|
214
|
+
// pointer because if this Arena isn't a root, it can't ever become one.
|
215
|
+
poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_acquire);
|
216
|
+
do {
|
164
217
|
upb_ArenaInternal* next = _upb_Arena_PointerFromTagged(poc);
|
218
|
+
UPB_TSAN_CHECK_PUBLISHED(next);
|
165
219
|
UPB_ASSERT(ai != next);
|
166
|
-
|
167
|
-
upb_Atomic_Load(&next->parent_or_count, memory_order_acquire);
|
220
|
+
poc = upb_Atomic_Load(&next->parent_or_count, memory_order_acquire);
|
168
221
|
|
169
|
-
if (_upb_Arena_IsTaggedPointer(
|
222
|
+
if (_upb_Arena_IsTaggedPointer(poc)) {
|
170
223
|
// To keep complexity down, we lazily collapse levels of the tree. This
|
171
224
|
// keeps it flat in the final case, but doesn't cost much incrementally.
|
172
225
|
//
|
173
226
|
// Path splitting keeps time complexity down, see:
|
174
227
|
// https://en.wikipedia.org/wiki/Disjoint-set_data_structure
|
175
|
-
|
176
|
-
|
177
|
-
// will converge on the same value and we don't need memory orderings to
|
178
|
-
// be visible.
|
179
|
-
//
|
180
|
-
// This is true because:
|
181
|
-
// - If no fuses occur, this will eventually become the root.
|
182
|
-
// - If fuses are actively occurring, the root may change, but the
|
183
|
-
// invariant is that `parent_or_count` merely points to *a* parent.
|
184
|
-
//
|
185
|
-
// In other words, it is moving towards "the" root, and that root may move
|
186
|
-
// further away over time, but the path towards that root will continue to
|
187
|
-
// be valid and the creation of the path carries all the memory orderings
|
188
|
-
// required.
|
189
|
-
UPB_ASSERT(ai != _upb_Arena_PointerFromTagged(next_poc));
|
190
|
-
upb_Atomic_Store(&ai->parent_or_count, next_poc, memory_order_relaxed);
|
228
|
+
UPB_ASSERT(ai != _upb_Arena_PointerFromTagged(poc));
|
229
|
+
upb_Atomic_Store(&ai->parent_or_count, poc, memory_order_release);
|
191
230
|
}
|
192
231
|
ai = next;
|
193
|
-
|
194
|
-
}
|
232
|
+
} while (_upb_Arena_IsTaggedPointer(poc));
|
195
233
|
return (upb_ArenaRoot){.root = ai, .tagged_count = poc};
|
196
234
|
}
|
197
235
|
|
198
|
-
|
199
|
-
|
200
|
-
|
236
|
+
uintptr_t upb_Arena_SpaceAllocated(const upb_Arena* arena,
|
237
|
+
size_t* fused_count) {
|
238
|
+
upb_ArenaInternal* ai = upb_Arena_Internal(arena);
|
239
|
+
uintptr_t memsize = 0;
|
201
240
|
size_t local_fused_count = 0;
|
202
|
-
|
241
|
+
// Our root would get updated by any racing fuses before our target arena
|
242
|
+
// became reachable from the root via the linked list; in order to preserve
|
243
|
+
// monotonic output (any arena counted by a previous invocation is counted by
|
244
|
+
// this one), we instead iterate forwards and backwards so that we only see
|
245
|
+
// the results of completed fuses.
|
246
|
+
uintptr_t previous_or_tail =
|
247
|
+
upb_Atomic_Load(&ai->previous_or_tail, memory_order_acquire);
|
248
|
+
while (_upb_Arena_IsTaggedPrevious(previous_or_tail)) {
|
249
|
+
upb_ArenaInternal* previous =
|
250
|
+
_upb_Arena_PreviousFromTagged(previous_or_tail);
|
251
|
+
UPB_ASSERT(previous != ai);
|
252
|
+
UPB_TSAN_CHECK_PUBLISHED(previous);
|
253
|
+
// Unfortunate macro behavior; prior to C11 when using nonstandard atomics
|
254
|
+
// this returns a void* and can't be used with += without an intermediate
|
255
|
+
// conversion to an integer.
|
256
|
+
// Relaxed is safe - no subsequent reads depend this one
|
257
|
+
uintptr_t allocated =
|
258
|
+
upb_Atomic_Load(&previous->space_allocated, memory_order_relaxed);
|
259
|
+
memsize += allocated;
|
260
|
+
previous_or_tail =
|
261
|
+
upb_Atomic_Load(&previous->previous_or_tail, memory_order_acquire);
|
262
|
+
local_fused_count++;
|
263
|
+
}
|
203
264
|
while (ai != NULL) {
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
265
|
+
UPB_TSAN_CHECK_PUBLISHED(ai);
|
266
|
+
// Unfortunate macro behavior; prior to C11 when using nonstandard atomics
|
267
|
+
// this returns a void* and can't be used with += without an intermediate
|
268
|
+
// conversion to an integer.
|
269
|
+
// Relaxed is safe - no subsequent reads depend this one
|
270
|
+
uintptr_t allocated =
|
271
|
+
upb_Atomic_Load(&ai->space_allocated, memory_order_relaxed);
|
272
|
+
memsize += allocated;
|
273
|
+
ai = upb_Atomic_Load(&ai->next, memory_order_acquire);
|
210
274
|
local_fused_count++;
|
211
275
|
}
|
212
276
|
|
@@ -214,44 +278,24 @@ size_t upb_Arena_SpaceAllocated(upb_Arena* arena, size_t* fused_count) {
|
|
214
278
|
return memsize;
|
215
279
|
}
|
216
280
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
upb_MemBlock* block = upb_Atomic_Load(&ai->blocks, memory_order_relaxed);
|
222
|
-
while (block) {
|
223
|
-
uintptr_t beg = (uintptr_t)block;
|
224
|
-
uintptr_t end = beg + block->size;
|
225
|
-
if ((uintptr_t)ptr >= beg && (uintptr_t)ptr < end) return true;
|
226
|
-
block = upb_Atomic_Load(&block->next, memory_order_relaxed);
|
227
|
-
}
|
228
|
-
|
229
|
-
return false;
|
230
|
-
}
|
231
|
-
|
232
|
-
uint32_t upb_Arena_DebugRefCount(upb_Arena* a) {
|
233
|
-
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
234
|
-
// These loads could probably be relaxed, but given that this is debug-only,
|
235
|
-
// it's not worth introducing a new variant for it.
|
236
|
-
uintptr_t poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_acquire);
|
237
|
-
while (_upb_Arena_IsTaggedPointer(poc)) {
|
238
|
-
ai = _upb_Arena_PointerFromTagged(poc);
|
239
|
-
poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_acquire);
|
240
|
-
}
|
241
|
-
return _upb_Arena_RefCountFromTagged(poc);
|
281
|
+
uint32_t upb_Arena_DebugRefCount(const upb_Arena* a) {
|
282
|
+
uintptr_t tagged = _upb_Arena_FindRoot(upb_Arena_Internal(a)).tagged_count;
|
283
|
+
return (uint32_t)_upb_Arena_RefCountFromTagged(tagged);
|
242
284
|
}
|
243
285
|
|
244
|
-
static void _upb_Arena_AddBlock(upb_Arena* a, void* ptr, size_t
|
286
|
+
static void _upb_Arena_AddBlock(upb_Arena* a, void* ptr, size_t offset,
|
287
|
+
size_t block_size) {
|
245
288
|
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
246
289
|
upb_MemBlock* block = ptr;
|
247
290
|
|
291
|
+
block->size = block_size;
|
248
292
|
// Insert into linked list.
|
249
|
-
block->
|
250
|
-
|
251
|
-
upb_Atomic_Store(&ai->blocks, block, memory_order_release);
|
293
|
+
block->next = ai->blocks;
|
294
|
+
ai->blocks = block;
|
252
295
|
|
253
|
-
|
254
|
-
a->UPB_PRIVATE(
|
296
|
+
UPB_ASSERT(offset >= kUpb_MemblockReserve);
|
297
|
+
a->UPB_PRIVATE(ptr) = UPB_PTR_AT(block, offset, char);
|
298
|
+
a->UPB_PRIVATE(end) = UPB_PTR_AT(block, block_size, char);
|
255
299
|
|
256
300
|
UPB_POISON_MEMORY_REGION(a->UPB_PRIVATE(ptr),
|
257
301
|
a->UPB_PRIVATE(end) - a->UPB_PRIVATE(ptr));
|
@@ -260,21 +304,37 @@ static void _upb_Arena_AddBlock(upb_Arena* a, void* ptr, size_t size) {
|
|
260
304
|
static bool _upb_Arena_AllocBlock(upb_Arena* a, size_t size) {
|
261
305
|
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
262
306
|
if (!ai->block_alloc) return false;
|
263
|
-
|
264
|
-
|
307
|
+
size_t last_size = 128;
|
308
|
+
upb_MemBlock* last_block = ai->blocks;
|
309
|
+
if (last_block) {
|
310
|
+
last_size = a->UPB_PRIVATE(end) - (char*)last_block;
|
311
|
+
}
|
312
|
+
|
313
|
+
// Relaxed order is safe here as we don't need any ordering with the setter.
|
314
|
+
size_t max_block_size =
|
315
|
+
upb_Atomic_Load(&g_max_block_size, memory_order_relaxed);
|
265
316
|
|
266
317
|
// Don't naturally grow beyond the max block size.
|
267
318
|
size_t clamped_size = UPB_MIN(last_size * 2, max_block_size);
|
268
319
|
|
269
320
|
// We may need to exceed the max block size if the user requested a large
|
270
321
|
// allocation.
|
271
|
-
size_t block_size = UPB_MAX(size, clamped_size)
|
322
|
+
size_t block_size = UPB_MAX(kUpb_MemblockReserve + size, clamped_size);
|
272
323
|
|
273
324
|
upb_MemBlock* block =
|
274
325
|
upb_malloc(_upb_ArenaInternal_BlockAlloc(ai), block_size);
|
275
326
|
|
276
327
|
if (!block) return false;
|
277
|
-
_upb_Arena_AddBlock(a, block, block_size);
|
328
|
+
_upb_Arena_AddBlock(a, block, kUpb_MemblockReserve, block_size);
|
329
|
+
// Atomic add not required here, as threads won't race allocating blocks, plus
|
330
|
+
// atomic fetch-add is slower than load/add/store on arm devices compiled
|
331
|
+
// targetting pre-v8.1. Relaxed order is safe as nothing depends on order of
|
332
|
+
// size allocated.
|
333
|
+
|
334
|
+
uintptr_t old_space_allocated =
|
335
|
+
upb_Atomic_Load(&ai->space_allocated, memory_order_relaxed);
|
336
|
+
upb_Atomic_Store(&ai->space_allocated, old_space_allocated + block_size,
|
337
|
+
memory_order_relaxed);
|
278
338
|
UPB_ASSERT(UPB_PRIVATE(_upb_ArenaHas)(a) >= size);
|
279
339
|
return true;
|
280
340
|
}
|
@@ -284,28 +344,33 @@ void* UPB_PRIVATE(_upb_Arena_SlowMalloc)(upb_Arena* a, size_t size) {
|
|
284
344
|
return upb_Arena_Malloc(a, size - UPB_ASAN_GUARD_SIZE);
|
285
345
|
}
|
286
346
|
|
287
|
-
static upb_Arena* _upb_Arena_InitSlow(upb_alloc* alloc) {
|
347
|
+
static upb_Arena* _upb_Arena_InitSlow(upb_alloc* alloc, size_t first_size) {
|
288
348
|
const size_t first_block_overhead =
|
289
|
-
sizeof(upb_ArenaState)
|
349
|
+
UPB_ALIGN_MALLOC(kUpb_MemblockReserve + sizeof(upb_ArenaState));
|
290
350
|
upb_ArenaState* a;
|
291
351
|
|
292
352
|
// We need to malloc the initial block.
|
293
353
|
char* mem;
|
294
|
-
size_t
|
295
|
-
|
354
|
+
size_t block_size =
|
355
|
+
first_block_overhead +
|
356
|
+
UPB_MAX(256, UPB_ALIGN_MALLOC(first_size) + UPB_ASAN_GUARD_SIZE);
|
357
|
+
if (!alloc || !(mem = upb_malloc(alloc, block_size))) {
|
296
358
|
return NULL;
|
297
359
|
}
|
298
360
|
|
299
|
-
a = UPB_PTR_AT(mem,
|
300
|
-
n -= sizeof(upb_ArenaState);
|
361
|
+
a = UPB_PTR_AT(mem, kUpb_MemblockReserve, upb_ArenaState);
|
301
362
|
|
302
363
|
a->body.block_alloc = _upb_Arena_MakeBlockAlloc(alloc, 0);
|
303
364
|
upb_Atomic_Init(&a->body.parent_or_count, _upb_Arena_TaggedFromRefcount(1));
|
304
365
|
upb_Atomic_Init(&a->body.next, NULL);
|
305
|
-
upb_Atomic_Init(&a->body.
|
306
|
-
|
366
|
+
upb_Atomic_Init(&a->body.previous_or_tail,
|
367
|
+
_upb_Arena_TaggedFromTail(&a->body));
|
368
|
+
upb_Atomic_Init(&a->body.space_allocated, block_size);
|
369
|
+
a->body.blocks = NULL;
|
370
|
+
a->body.upb_alloc_cleanup = NULL;
|
371
|
+
UPB_TSAN_INIT_PUBLISHED(&a->body);
|
307
372
|
|
308
|
-
_upb_Arena_AddBlock(&a->head, mem,
|
373
|
+
_upb_Arena_AddBlock(&a->head, mem, first_block_overhead, block_size);
|
309
374
|
|
310
375
|
return &a->head;
|
311
376
|
}
|
@@ -314,38 +379,34 @@ upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc) {
|
|
314
379
|
UPB_ASSERT(sizeof(void*) * UPB_ARENA_SIZE_HACK >= sizeof(upb_ArenaState));
|
315
380
|
upb_ArenaState* a;
|
316
381
|
|
317
|
-
if (
|
382
|
+
if (mem) {
|
318
383
|
/* Align initial pointer up so that we return properly-aligned pointers. */
|
319
|
-
void* aligned = (void*)
|
384
|
+
void* aligned = (void*)UPB_ALIGN_MALLOC((uintptr_t)mem);
|
320
385
|
size_t delta = (uintptr_t)aligned - (uintptr_t)mem;
|
321
386
|
n = delta <= n ? n - delta : 0;
|
322
387
|
mem = aligned;
|
323
388
|
}
|
324
|
-
|
325
|
-
|
326
|
-
* itself at the end. */
|
327
|
-
n = UPB_ALIGN_DOWN(n, UPB_ALIGN_OF(upb_ArenaState));
|
328
|
-
|
329
|
-
if (UPB_UNLIKELY(n < sizeof(upb_ArenaState))) {
|
389
|
+
if (UPB_UNLIKELY(n < sizeof(upb_ArenaState) || !mem)) {
|
390
|
+
upb_Arena* ret = _upb_Arena_InitSlow(alloc, mem ? 0 : n);
|
330
391
|
#ifdef UPB_TRACING_ENABLED
|
331
|
-
upb_Arena* ret = _upb_Arena_InitSlow(alloc);
|
332
392
|
upb_Arena_LogInit(ret, n);
|
333
|
-
return ret;
|
334
|
-
#else
|
335
|
-
return _upb_Arena_InitSlow(alloc);
|
336
393
|
#endif
|
394
|
+
return ret;
|
337
395
|
}
|
338
396
|
|
339
|
-
a =
|
397
|
+
a = mem;
|
340
398
|
|
341
399
|
upb_Atomic_Init(&a->body.parent_or_count, _upb_Arena_TaggedFromRefcount(1));
|
342
400
|
upb_Atomic_Init(&a->body.next, NULL);
|
343
|
-
upb_Atomic_Init(&a->body.
|
344
|
-
|
345
|
-
|
401
|
+
upb_Atomic_Init(&a->body.previous_or_tail,
|
402
|
+
_upb_Arena_TaggedFromTail(&a->body));
|
403
|
+
upb_Atomic_Init(&a->body.space_allocated, 0);
|
404
|
+
a->body.blocks = NULL;
|
405
|
+
a->body.upb_alloc_cleanup = NULL;
|
346
406
|
a->body.block_alloc = _upb_Arena_MakeBlockAlloc(alloc, 1);
|
347
|
-
a->head.UPB_PRIVATE(ptr) =
|
348
|
-
a->head.UPB_PRIVATE(end) = UPB_PTR_AT(mem, n
|
407
|
+
a->head.UPB_PRIVATE(ptr) = (void*)UPB_ALIGN_MALLOC((uintptr_t)(a + 1));
|
408
|
+
a->head.UPB_PRIVATE(end) = UPB_PTR_AT(mem, n, char);
|
409
|
+
UPB_TSAN_INIT_PUBLISHED(&a->body);
|
349
410
|
#ifdef UPB_TRACING_ENABLED
|
350
411
|
upb_Arena_LogInit(&a->head, n);
|
351
412
|
#endif
|
@@ -355,28 +416,40 @@ upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc) {
|
|
355
416
|
static void _upb_Arena_DoFree(upb_ArenaInternal* ai) {
|
356
417
|
UPB_ASSERT(_upb_Arena_RefCountFromTagged(ai->parent_or_count) == 1);
|
357
418
|
while (ai != NULL) {
|
419
|
+
UPB_TSAN_CHECK_PUBLISHED(ai);
|
358
420
|
// Load first since arena itself is likely from one of its blocks.
|
359
421
|
upb_ArenaInternal* next_arena =
|
360
422
|
(upb_ArenaInternal*)upb_Atomic_Load(&ai->next, memory_order_acquire);
|
423
|
+
// Freeing may have memory barriers that confuse tsan, so assert immdiately
|
424
|
+
// after load here
|
425
|
+
if (next_arena) {
|
426
|
+
UPB_TSAN_CHECK_PUBLISHED(next_arena);
|
427
|
+
}
|
361
428
|
upb_alloc* block_alloc = _upb_ArenaInternal_BlockAlloc(ai);
|
362
|
-
upb_MemBlock* block =
|
429
|
+
upb_MemBlock* block = ai->blocks;
|
430
|
+
upb_AllocCleanupFunc* alloc_cleanup = *ai->upb_alloc_cleanup;
|
363
431
|
while (block != NULL) {
|
364
432
|
// Load first since we are deleting block.
|
365
|
-
upb_MemBlock* next_block =
|
366
|
-
|
367
|
-
upb_free(block_alloc, block);
|
433
|
+
upb_MemBlock* next_block = block->next;
|
434
|
+
upb_free_sized(block_alloc, block, block->size);
|
368
435
|
block = next_block;
|
369
436
|
}
|
437
|
+
if (alloc_cleanup != NULL) {
|
438
|
+
alloc_cleanup(block_alloc);
|
439
|
+
}
|
370
440
|
ai = next_arena;
|
371
441
|
}
|
372
442
|
}
|
373
443
|
|
374
444
|
void upb_Arena_Free(upb_Arena* a) {
|
375
445
|
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
446
|
+
// Cannot be replaced with _upb_Arena_FindRoot, as that provides only a
|
447
|
+
// relaxed read of the refcount if ai is already the root.
|
376
448
|
uintptr_t poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_acquire);
|
377
449
|
retry:
|
378
450
|
while (_upb_Arena_IsTaggedPointer(poc)) {
|
379
451
|
ai = _upb_Arena_PointerFromTagged(poc);
|
452
|
+
UPB_TSAN_CHECK_PUBLISHED(ai);
|
380
453
|
poc = upb_Atomic_Load(&ai->parent_or_count, memory_order_acquire);
|
381
454
|
}
|
382
455
|
|
@@ -406,32 +479,70 @@ retry:
|
|
406
479
|
|
407
480
|
static void _upb_Arena_DoFuseArenaLists(upb_ArenaInternal* const parent,
|
408
481
|
upb_ArenaInternal* child) {
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
482
|
+
UPB_TSAN_CHECK_PUBLISHED(parent);
|
483
|
+
uintptr_t parent_previous_or_tail =
|
484
|
+
upb_Atomic_Load(&parent->previous_or_tail, memory_order_acquire);
|
485
|
+
upb_ArenaInternal* parent_tail = parent;
|
486
|
+
if (_upb_Arena_IsTaggedTail(parent_previous_or_tail)) {
|
413
487
|
// Our tail might be stale, but it will always converge to the true tail.
|
488
|
+
parent_tail = _upb_Arena_TailFromTagged(parent_previous_or_tail);
|
489
|
+
}
|
490
|
+
|
491
|
+
// Link parent to child going forwards
|
492
|
+
while (true) {
|
493
|
+
UPB_TSAN_CHECK_PUBLISHED(parent_tail);
|
414
494
|
upb_ArenaInternal* parent_tail_next =
|
415
|
-
upb_Atomic_Load(&parent_tail->next,
|
495
|
+
upb_Atomic_Load(&parent_tail->next, memory_order_acquire);
|
416
496
|
while (parent_tail_next != NULL) {
|
417
497
|
parent_tail = parent_tail_next;
|
498
|
+
UPB_TSAN_CHECK_PUBLISHED(parent_tail);
|
418
499
|
parent_tail_next =
|
419
|
-
upb_Atomic_Load(&parent_tail->next,
|
500
|
+
upb_Atomic_Load(&parent_tail->next, memory_order_acquire);
|
501
|
+
}
|
502
|
+
if (upb_Atomic_CompareExchangeWeak(&parent_tail->next, &parent_tail_next,
|
503
|
+
child, memory_order_release,
|
504
|
+
memory_order_acquire)) {
|
505
|
+
break;
|
420
506
|
}
|
507
|
+
if (parent_tail_next != NULL) {
|
508
|
+
parent_tail = parent_tail_next;
|
509
|
+
}
|
510
|
+
}
|
421
511
|
|
422
|
-
|
423
|
-
|
424
|
-
|
512
|
+
// Update parent's tail (may be stale).
|
513
|
+
uintptr_t child_previous_or_tail =
|
514
|
+
upb_Atomic_Load(&child->previous_or_tail, memory_order_acquire);
|
515
|
+
upb_ArenaInternal* new_parent_tail =
|
516
|
+
_upb_Arena_TailFromTagged(child_previous_or_tail);
|
517
|
+
UPB_TSAN_CHECK_PUBLISHED(new_parent_tail);
|
518
|
+
|
519
|
+
// If another thread fused with us, don't overwrite their previous pointer
|
520
|
+
// with our tail. Relaxed order is fine here as we only inspect the tag bit
|
521
|
+
parent_previous_or_tail =
|
522
|
+
upb_Atomic_Load(&parent->previous_or_tail, memory_order_relaxed);
|
523
|
+
if (_upb_Arena_IsTaggedTail(parent_previous_or_tail)) {
|
524
|
+
upb_Atomic_CompareExchangeStrong(
|
525
|
+
&parent->previous_or_tail, &parent_previous_or_tail,
|
526
|
+
_upb_Arena_TaggedFromTail(new_parent_tail), memory_order_release,
|
527
|
+
memory_order_relaxed);
|
528
|
+
}
|
425
529
|
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
530
|
+
// Link child to parent going backwards, for SpaceAllocated
|
531
|
+
upb_Atomic_Store(&child->previous_or_tail,
|
532
|
+
_upb_Arena_TaggedFromPrevious(parent_tail),
|
533
|
+
memory_order_release);
|
534
|
+
}
|
430
535
|
|
431
|
-
|
536
|
+
void upb_Arena_SetAllocCleanup(upb_Arena* a, upb_AllocCleanupFunc* func) {
|
537
|
+
UPB_TSAN_CHECK_READ(a->UPB_ONLYBITS(ptr));
|
538
|
+
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
539
|
+
UPB_ASSERT(ai->upb_alloc_cleanup == NULL);
|
540
|
+
ai->upb_alloc_cleanup = func;
|
432
541
|
}
|
433
542
|
|
434
|
-
|
543
|
+
// Thread safe.
|
544
|
+
static upb_ArenaInternal* _upb_Arena_DoFuse(upb_ArenaInternal** ai1,
|
545
|
+
upb_ArenaInternal** ai2,
|
435
546
|
uintptr_t* ref_delta) {
|
436
547
|
// `parent_or_count` has two distinct modes
|
437
548
|
// - parent pointer mode
|
@@ -440,11 +551,14 @@ static upb_ArenaInternal* _upb_Arena_DoFuse(upb_Arena* a1, upb_Arena* a2,
|
|
440
551
|
// In parent pointer mode, it may change what pointer it refers to in the
|
441
552
|
// tree, but it will always approach a root. Any operation that walks the
|
442
553
|
// tree to the root may collapse levels of the tree concurrently.
|
443
|
-
upb_ArenaRoot r1 = _upb_Arena_FindRoot(
|
444
|
-
upb_ArenaRoot r2 = _upb_Arena_FindRoot(
|
554
|
+
upb_ArenaRoot r1 = _upb_Arena_FindRoot(*ai1);
|
555
|
+
upb_ArenaRoot r2 = _upb_Arena_FindRoot(*ai2);
|
445
556
|
|
446
557
|
if (r1.root == r2.root) return r1.root; // Already fused.
|
447
558
|
|
559
|
+
*ai1 = r1.root;
|
560
|
+
*ai2 = r2.root;
|
561
|
+
|
448
562
|
// Avoid cycles by always fusing into the root with the lower address.
|
449
563
|
if ((uintptr_t)r1.root > (uintptr_t)r2.root) {
|
450
564
|
upb_ArenaRoot tmp = r1;
|
@@ -490,20 +604,33 @@ static upb_ArenaInternal* _upb_Arena_DoFuse(upb_Arena* a1, upb_Arena* a2,
|
|
490
604
|
return r1.root;
|
491
605
|
}
|
492
606
|
|
607
|
+
// Thread safe.
|
493
608
|
static bool _upb_Arena_FixupRefs(upb_ArenaInternal* new_root,
|
494
609
|
uintptr_t ref_delta) {
|
495
610
|
if (ref_delta == 0) return true; // No fixup required.
|
611
|
+
// Relaxed order is safe here as if the value is a pointer, we don't deref it
|
612
|
+
// or publish it anywhere else. The refcount does provide memory order
|
613
|
+
// between allocations on arenas and the eventual free and thus normally
|
614
|
+
// requires acquire/release; but in this case any edges provided by the refs
|
615
|
+
// we are cleaning up were already provided by the fuse operation itself. It's
|
616
|
+
// not valid for a decrement that could cause the overall fused arena to reach
|
617
|
+
// a zero refcount to race with this function, as that could result in a
|
618
|
+
// use-after-free anyway.
|
496
619
|
uintptr_t poc =
|
497
620
|
upb_Atomic_Load(&new_root->parent_or_count, memory_order_relaxed);
|
498
621
|
if (_upb_Arena_IsTaggedPointer(poc)) return false;
|
499
622
|
uintptr_t with_refs = poc - ref_delta;
|
500
623
|
UPB_ASSERT(!_upb_Arena_IsTaggedPointer(with_refs));
|
624
|
+
// Relaxed order on success is safe here, for the same reasons as the relaxed
|
625
|
+
// read above. Relaxed order is safe on failure because the updated value is
|
626
|
+
// stored in a local variable which goes immediately out of scope; the retry
|
627
|
+
// loop will reread what it needs with proper memory order.
|
501
628
|
return upb_Atomic_CompareExchangeStrong(&new_root->parent_or_count, &poc,
|
502
629
|
with_refs, memory_order_relaxed,
|
503
630
|
memory_order_relaxed);
|
504
631
|
}
|
505
632
|
|
506
|
-
bool upb_Arena_Fuse(upb_Arena* a1, upb_Arena* a2) {
|
633
|
+
bool upb_Arena_Fuse(const upb_Arena* a1, const upb_Arena* a2) {
|
507
634
|
if (a1 == a2) return true; // trivial fuse
|
508
635
|
|
509
636
|
#ifdef UPB_TRACING_ENABLED
|
@@ -523,25 +650,46 @@ bool upb_Arena_Fuse(upb_Arena* a1, upb_Arena* a2) {
|
|
523
650
|
// The number of refs we ultimately need to transfer to the new root.
|
524
651
|
uintptr_t ref_delta = 0;
|
525
652
|
while (true) {
|
526
|
-
upb_ArenaInternal* new_root = _upb_Arena_DoFuse(
|
653
|
+
upb_ArenaInternal* new_root = _upb_Arena_DoFuse(&ai1, &ai2, &ref_delta);
|
527
654
|
if (new_root != NULL && _upb_Arena_FixupRefs(new_root, ref_delta)) {
|
528
655
|
return true;
|
529
656
|
}
|
530
657
|
}
|
531
658
|
}
|
532
659
|
|
533
|
-
bool
|
660
|
+
bool upb_Arena_IsFused(const upb_Arena* a, const upb_Arena* b) {
|
661
|
+
if (a == b) return true; // trivial fuse
|
662
|
+
upb_ArenaInternal* ra = _upb_Arena_FindRoot(upb_Arena_Internal(a)).root;
|
663
|
+
upb_ArenaInternal* rb = upb_Arena_Internal(b);
|
664
|
+
while (true) {
|
665
|
+
rb = _upb_Arena_FindRoot(rb).root;
|
666
|
+
if (ra == rb) return true;
|
667
|
+
upb_ArenaInternal* tmp = _upb_Arena_FindRoot(ra).root;
|
668
|
+
if (ra == tmp) return false;
|
669
|
+
// a's root changed since we last checked. Retry.
|
670
|
+
ra = tmp;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
|
674
|
+
bool upb_Arena_IncRefFor(const upb_Arena* a, const void* owner) {
|
534
675
|
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
535
676
|
if (_upb_ArenaInternal_HasInitialBlock(ai)) return false;
|
536
677
|
upb_ArenaRoot r;
|
678
|
+
r.root = ai;
|
537
679
|
|
538
680
|
retry:
|
539
|
-
r = _upb_Arena_FindRoot(
|
681
|
+
r = _upb_Arena_FindRoot(r.root);
|
540
682
|
if (upb_Atomic_CompareExchangeWeak(
|
541
683
|
&r.root->parent_or_count, &r.tagged_count,
|
542
684
|
_upb_Arena_TaggedFromRefcount(
|
543
685
|
_upb_Arena_RefCountFromTagged(r.tagged_count) + 1),
|
544
|
-
|
686
|
+
// Relaxed order is safe on success, incrementing the refcount
|
687
|
+
// need not perform any synchronization with the eventual free of the
|
688
|
+
// arena - that's provided by decrements.
|
689
|
+
memory_order_relaxed,
|
690
|
+
// Relaxed order is safe on failure as r.tagged_count is immediately
|
691
|
+
// overwritten by retrying the find root operation.
|
692
|
+
memory_order_relaxed)) {
|
545
693
|
// We incremented it successfully, so we are done.
|
546
694
|
return true;
|
547
695
|
}
|
@@ -549,7 +697,15 @@ retry:
|
|
549
697
|
goto retry;
|
550
698
|
}
|
551
699
|
|
552
|
-
void upb_Arena_DecRefFor(upb_Arena* a, const void* owner) {
|
700
|
+
void upb_Arena_DecRefFor(const upb_Arena* a, const void* owner) {
|
701
|
+
upb_Arena_Free((upb_Arena*)a);
|
702
|
+
}
|
703
|
+
|
704
|
+
upb_alloc* upb_Arena_GetUpbAlloc(upb_Arena* a) {
|
705
|
+
UPB_TSAN_CHECK_READ(a->UPB_ONLYBITS(ptr));
|
706
|
+
upb_ArenaInternal* ai = upb_Arena_Internal(a);
|
707
|
+
return _upb_ArenaInternal_BlockAlloc(ai);
|
708
|
+
}
|
553
709
|
|
554
710
|
void UPB_PRIVATE(_upb_Arena_SwapIn)(upb_Arena* des, const upb_Arena* src) {
|
555
711
|
upb_ArenaInternal* desi = upb_Arena_Internal(des);
|
@@ -557,8 +713,7 @@ void UPB_PRIVATE(_upb_Arena_SwapIn)(upb_Arena* des, const upb_Arena* src) {
|
|
557
713
|
|
558
714
|
*des = *src;
|
559
715
|
desi->block_alloc = srci->block_alloc;
|
560
|
-
|
561
|
-
upb_Atomic_Init(&desi->blocks, blocks);
|
716
|
+
desi->blocks = srci->blocks;
|
562
717
|
}
|
563
718
|
|
564
719
|
void UPB_PRIVATE(_upb_Arena_SwapOut)(upb_Arena* des, const upb_Arena* src) {
|
@@ -566,6 +721,5 @@ void UPB_PRIVATE(_upb_Arena_SwapOut)(upb_Arena* des, const upb_Arena* src) {
|
|
566
721
|
upb_ArenaInternal* srci = upb_Arena_Internal(src);
|
567
722
|
|
568
723
|
*des = *src;
|
569
|
-
|
570
|
-
upb_Atomic_Store(&desi->blocks, blocks, memory_order_relaxed);
|
724
|
+
desi->blocks = srci->blocks;
|
571
725
|
}
|