grpc 1.57.0 → 1.58.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +534 -284
- data/include/grpc/event_engine/event_engine.h +0 -1
- data/include/grpc/event_engine/memory_allocator.h +2 -2
- data/include/grpc/impl/channel_arg_names.h +371 -0
- data/include/grpc/impl/grpc_types.h +1 -353
- data/include/grpc/module.modulemap +1 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +2 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +7 -3
- data/src/core/ext/filters/client_channel/http_proxy.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +5 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +115 -109
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +0 -5
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +7 -2
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -1
- 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 +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +11 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +6 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +8 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +102 -11
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +9 -4
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -1
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.cc +6 -0
- data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +41 -14
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -1
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +1 -1
- data/src/core/ext/filters/client_channel/subchannel.cc +9 -5
- data/src/core/ext/filters/client_channel/subchannel.h +8 -2
- data/src/core/ext/filters/deadline/deadline_filter.cc +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +1 -0
- data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -0
- 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 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +4 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -12
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +357 -358
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -18
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +63 -4
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +7 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +30 -57
- data/src/core/ext/transport/chttp2/transport/parsing.cc +16 -7
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +80 -0
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +55 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +98 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +73 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +81 -89
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -0
- data/src/core/ext/xds/xds_client_grpc.cc +1 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +1 -2
- data/src/core/ext/xds/xds_http_fault_filter.h +1 -2
- data/src/core/ext/xds/xds_http_filters.h +2 -4
- data/src/core/ext/xds/xds_http_rbac_filter.cc +3 -8
- data/src/core/ext/xds/xds_http_rbac_filter.h +1 -2
- data/src/core/ext/xds/xds_http_stateful_session_filter.cc +1 -2
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +1 -2
- data/src/core/ext/xds/xds_lb_policy_registry.cc +3 -6
- data/src/core/ext/xds/xds_routing.cc +2 -2
- data/src/core/ext/xds/xds_transport_grpc.cc +1 -0
- data/src/core/lib/avl/avl.h +10 -173
- data/src/core/lib/channel/call_tracer.cc +289 -0
- data/src/core/lib/channel/call_tracer.h +35 -0
- data/src/core/lib/channel/channel_args.cc +84 -79
- data/src/core/lib/channel/channel_args.h +29 -17
- data/src/core/lib/channel/connected_channel.cc +0 -1
- data/src/core/lib/channel/promise_based_filter.cc +4 -1
- data/src/core/lib/compression/compression_internal.cc +8 -4
- data/src/core/lib/debug/stats_data.cc +93 -21
- data/src/core/lib/debug/stats_data.h +41 -0
- data/src/core/lib/event_engine/ares_resolver.cc +712 -0
- data/src/core/lib/event_engine/ares_resolver.h +150 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +9 -3
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +2 -2
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +229 -0
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +117 -0
- data/src/core/lib/event_engine/forkable.cc +15 -1
- data/src/core/lib/event_engine/forkable.h +15 -0
- data/src/core/lib/event_engine/grpc_polled_fd.h +73 -0
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +25 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +10 -1
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +197 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +47 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +12 -1
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -0
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +2 -0
- data/src/core/lib/event_engine/thread_pool/thread_count.cc +58 -0
- data/src/core/lib/event_engine/thread_pool/thread_count.h +161 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +7 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +86 -111
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +15 -61
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +3 -4
- data/src/core/lib/experiments/config.cc +14 -0
- data/src/core/lib/experiments/experiments.cc +141 -304
- data/src/core/lib/experiments/experiments.h +16 -17
- data/src/core/lib/gprpp/ref_counted.h +3 -1
- data/src/core/lib/gprpp/ref_counted_string.cc +44 -0
- data/src/core/lib/gprpp/ref_counted_string.h +146 -0
- data/src/core/lib/gprpp/time.h +2 -2
- data/src/core/lib/gprpp/work_serializer.cc +36 -0
- data/src/core/lib/gprpp/work_serializer.h +5 -0
- data/src/core/lib/http/httpcli_security_connector.cc +1 -0
- data/src/core/lib/iomgr/buffer_list.cc +2 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +7 -22
- data/src/core/lib/iomgr/tcp_posix.cc +3 -3
- data/src/core/lib/promise/detail/basic_seq.h +1 -372
- data/src/core/lib/promise/detail/seq_state.h +2076 -0
- data/src/core/lib/promise/seq.h +19 -2
- data/src/core/lib/promise/sleep.h +5 -10
- data/src/core/lib/promise/try_seq.h +34 -2
- data/src/core/lib/resource_quota/api.cc +1 -0
- data/src/core/lib/resource_quota/arena.cc +2 -0
- data/src/core/lib/resource_quota/arena.h +42 -8
- data/src/core/lib/resource_quota/memory_quota.cc +0 -1
- data/src/core/lib/resource_quota/resource_quota.h +1 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
- data/src/core/lib/security/authorization/rbac_policy.h +1 -1
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +8 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +17 -0
- data/src/core/lib/security/credentials/jwt/json_token.h +4 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +42 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -0
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -0
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl_utils.cc +1 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +8 -5
- data/src/core/lib/security/transport/security_handshaker.cc +1 -0
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
- data/src/core/lib/surface/call.cc +32 -8
- data/src/core/lib/surface/channel.cc +1 -0
- data/src/core/lib/surface/completion_queue.cc +10 -0
- data/src/core/lib/surface/init.cc +1 -0
- data/src/core/lib/surface/server.cc +67 -64
- data/src/core/lib/surface/server.h +1 -15
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/tsi/alts/crypt/aes_gcm.cc +27 -2
- data/src/core/tsi/ssl_transport_security.cc +11 -0
- data/src/ruby/lib/grpc/generic/active_call.rb +9 -14
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/test/client.rb +16 -0
- data/src/ruby/spec/generic/rpc_server_spec.rb +3 -3
- data/third_party/abseil-cpp/absl/algorithm/container.h +3 -2
- data/third_party/abseil-cpp/absl/base/attributes.h +58 -5
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
- data/third_party/abseil-cpp/absl/base/casts.h +8 -8
- data/third_party/abseil-cpp/absl/base/config.h +89 -106
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +26 -1
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +50 -39
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/prefetch.h +17 -18
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +32 -3
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +24 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +31 -73
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -8
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +11 -11
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +23 -32
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +2 -3
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/policy_checks.h +3 -3
- data/third_party/abseil-cpp/absl/base/prefetch.h +198 -0
- data/third_party/abseil-cpp/absl/container/fixed_array.h +54 -29
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -1
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -2
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +167 -79
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +3 -21
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +46 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -0
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +85 -26
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +35 -18
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +70 -29
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +437 -236
- data/third_party/abseil-cpp/absl/crc/crc32c.h +8 -1
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +14 -8
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -35
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +2 -10
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +1 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +1 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +4 -4
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +8 -10
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +17 -19
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +8 -8
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +2 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +59 -23
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +43 -19
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -0
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +1 -1
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc +1 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -2
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +16 -15
- data/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc +1 -1
- data/third_party/abseil-cpp/absl/flags/marshalling.cc +43 -2
- data/third_party/abseil-cpp/absl/flags/marshalling.h +5 -0
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +9 -1
- data/third_party/abseil-cpp/absl/functional/bind_front.h +1 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +3 -3
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +37 -24
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +19 -9
- data/third_party/abseil-cpp/absl/hash/hash.h +7 -4
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +38 -15
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +6 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +48 -373
- data/third_party/abseil-cpp/absl/numeric/bits.h +4 -4
- data/third_party/abseil-cpp/absl/numeric/int128.cc +20 -8
- data/third_party/abseil-cpp/absl/numeric/int128.h +36 -39
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +0 -3
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +47 -30
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +4 -3
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/platform.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +4 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +1 -1
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +1 -1
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +4 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +12 -24
- data/third_party/abseil-cpp/absl/status/status.cc +11 -7
- data/third_party/abseil-cpp/absl/status/status.h +11 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +22 -8
- data/third_party/abseil-cpp/absl/strings/ascii.cc +54 -6
- data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -4
- data/third_party/abseil-cpp/absl/strings/charconv.h +2 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +1 -2
- data/third_party/abseil-cpp/absl/strings/cord.h +32 -5
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +23 -1
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +18 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +2 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +10 -32
- data/third_party/abseil-cpp/absl/strings/escaping.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +2 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +0 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +15 -13
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +13 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +5 -3
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +4 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +46 -20
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +1 -34
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +23 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +2 -77
- data/third_party/abseil-cpp/absl/strings/internal/memutil.h +4 -112
- data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +10 -31
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -8
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +5 -20
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +56 -6
- data/third_party/abseil-cpp/absl/strings/match.cc +87 -0
- data/third_party/abseil-cpp/absl/strings/match.h +19 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +154 -122
- data/third_party/abseil-cpp/absl/strings/numbers.h +1 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +7 -50
- data/third_party/abseil-cpp/absl/strings/str_cat.h +83 -15
- data/third_party/abseil-cpp/absl/strings/str_format.h +6 -3
- data/third_party/abseil-cpp/absl/strings/str_split.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/string_view.cc +26 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +5 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +63 -43
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +111 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +11 -7
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +225 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +122 -114
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +12 -8
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +10 -1
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +167 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +122 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +91 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +19 -113
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +42 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +151 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.h +70 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +407 -411
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +152 -118
- data/third_party/abseil-cpp/absl/time/clock.cc +6 -7
- data/third_party/abseil-cpp/absl/time/duration.cc +24 -26
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +3 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +8 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +6 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +4 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +4 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +322 -295
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +8 -17
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +51 -33
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +7 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +128 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +5 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +34 -34
- data/third_party/abseil-cpp/absl/time/time.cc +9 -2
- data/third_party/abseil-cpp/absl/time/time.h +115 -15
- data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -52
- data/third_party/abseil-cpp/absl/types/internal/span.h +2 -2
- data/third_party/abseil-cpp/absl/types/internal/variant.h +2 -2
- data/third_party/abseil-cpp/absl/types/optional.h +15 -13
- data/third_party/abseil-cpp/absl/types/span.h +1 -2
- data/third_party/boringssl-with-bazel/err_data.c +15 -14
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/bio/errno.c +92 -0
- data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +4 -48
- data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +11 -6
- data/third_party/boringssl-with-bazel/src/crypto/bio/internal.h +16 -6
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +3 -7
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.c +93 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +9 -14
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +4 -6
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +10 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/check.c +37 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +38 -19
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +39 -16
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/service_indicator.c +4 -7
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +13 -21
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +6 -23
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +0 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +2 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +9 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +11 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +7 -9
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +6 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +22 -20
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +20 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/target.h +50 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +0 -4
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +4 -4
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +2 -0
- metadata +41 -33
- data/src/core/lib/promise/detail/basic_join.h +0 -197
- data/src/core/lib/promise/detail/switch.h +0 -1455
- data/src/core/lib/promise/try_join.h +0 -82
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -403
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_freebsd.c +0 -62
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm.c +0 -38
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_openbsd.c +0 -31
- data/third_party/re2/util/benchmark.h +0 -156
- data/third_party/re2/util/flags.h +0 -26
- data/third_party/re2/util/malloc_counter.h +0 -19
- data/third_party/re2/util/pcre.cc +0 -1025
- data/third_party/re2/util/pcre.h +0 -681
- data/third_party/re2/util/test.h +0 -50
- data/third_party/upb/upb/mini_table.h +0 -36
- data/third_party/zlib/gzclose.c +0 -25
- data/third_party/zlib/gzlib.c +0 -639
- data/third_party/zlib/gzread.c +0 -650
- data/third_party/zlib/gzwrite.c +0 -677
@@ -532,6 +532,11 @@ bool ForEachSection(int fd,
|
|
532
532
|
return false;
|
533
533
|
}
|
534
534
|
|
535
|
+
// Technically it can be larger, but in practice this never happens.
|
536
|
+
if (elf_header.e_shentsize != sizeof(ElfW(Shdr))) {
|
537
|
+
return false;
|
538
|
+
}
|
539
|
+
|
535
540
|
ElfW(Shdr) shstrtab;
|
536
541
|
off_t shstrtab_offset = static_cast<off_t>(elf_header.e_shoff) +
|
537
542
|
elf_header.e_shentsize * elf_header.e_shstrndx;
|
@@ -584,6 +589,11 @@ bool GetSectionHeaderByName(int fd, const char *name, size_t name_len,
|
|
584
589
|
return false;
|
585
590
|
}
|
586
591
|
|
592
|
+
// Technically it can be larger, but in practice this never happens.
|
593
|
+
if (elf_header.e_shentsize != sizeof(ElfW(Shdr))) {
|
594
|
+
return false;
|
595
|
+
}
|
596
|
+
|
587
597
|
ElfW(Shdr) shstrtab;
|
588
598
|
off_t shstrtab_offset = static_cast<off_t>(elf_header.e_shoff) +
|
589
599
|
elf_header.e_shentsize * elf_header.e_shstrndx;
|
@@ -648,8 +658,10 @@ static bool ShouldPickFirstSymbol(const ElfW(Sym) & symbol1,
|
|
648
658
|
}
|
649
659
|
|
650
660
|
// Return true if an address is inside a section.
|
651
|
-
static bool InSection(const void *address,
|
652
|
-
|
661
|
+
static bool InSection(const void *address, ptrdiff_t relocation,
|
662
|
+
const ElfW(Shdr) * section) {
|
663
|
+
const char *start = reinterpret_cast<const char *>(
|
664
|
+
section->sh_addr + static_cast<ElfW(Addr)>(relocation));
|
653
665
|
size_t size = static_cast<size_t>(section->sh_size);
|
654
666
|
return start <= address && address < (start + size);
|
655
667
|
}
|
@@ -689,8 +701,8 @@ static ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol(
|
|
689
701
|
// starting address. However, we do not always want to use the real
|
690
702
|
// starting address because we sometimes want to symbolize a function
|
691
703
|
// pointer into the .opd section, e.g. FindSymbol(&foo,...).
|
692
|
-
const bool pc_in_opd =
|
693
|
-
|
704
|
+
const bool pc_in_opd = kPlatformUsesOPDSections && opd != nullptr &&
|
705
|
+
InSection(pc, relocation, opd);
|
694
706
|
const bool deref_function_descriptor_pointer =
|
695
707
|
kPlatformUsesOPDSections && opd != nullptr && !pc_in_opd;
|
696
708
|
|
@@ -730,7 +742,7 @@ static ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol(
|
|
730
742
|
#endif
|
731
743
|
|
732
744
|
if (deref_function_descriptor_pointer &&
|
733
|
-
InSection(original_start_address, opd)) {
|
745
|
+
InSection(original_start_address, /*relocation=*/0, opd)) {
|
734
746
|
// The opd section is mapped into memory. Just dereference
|
735
747
|
// start_address to get the first double word, which points to the
|
736
748
|
// function entry.
|
@@ -1326,7 +1338,7 @@ static bool MaybeInitializeObjFile(ObjFile *obj) {
|
|
1326
1338
|
const int phnum = obj->elf_header.e_phnum;
|
1327
1339
|
const int phentsize = obj->elf_header.e_phentsize;
|
1328
1340
|
auto phoff = static_cast<off_t>(obj->elf_header.e_phoff);
|
1329
|
-
size_t
|
1341
|
+
size_t num_interesting_load_segments = 0;
|
1330
1342
|
for (int j = 0; j < phnum; j++) {
|
1331
1343
|
ElfW(Phdr) phdr;
|
1332
1344
|
if (!ReadFromOffsetExact(obj->fd, &phdr, sizeof(phdr), phoff)) {
|
@@ -1335,23 +1347,35 @@ static bool MaybeInitializeObjFile(ObjFile *obj) {
|
|
1335
1347
|
return false;
|
1336
1348
|
}
|
1337
1349
|
phoff += phentsize;
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1350
|
+
|
1351
|
+
#if defined(__powerpc__) && !(_CALL_ELF > 1)
|
1352
|
+
// On the PowerPC ELF v1 ABI, function pointers actually point to function
|
1353
|
+
// descriptors. These descriptors are stored in an .opd section, which is
|
1354
|
+
// mapped read-only. We thus need to look at all readable segments, not
|
1355
|
+
// just the executable ones.
|
1356
|
+
constexpr int interesting = PF_R;
|
1357
|
+
#else
|
1358
|
+
constexpr int interesting = PF_X | PF_R;
|
1359
|
+
#endif
|
1360
|
+
|
1361
|
+
if (phdr.p_type != PT_LOAD
|
1362
|
+
|| (phdr.p_flags & interesting) != interesting) {
|
1363
|
+
// Not a LOAD segment, not executable code, and not a function
|
1364
|
+
// descriptor.
|
1341
1365
|
continue;
|
1342
1366
|
}
|
1343
|
-
if (
|
1344
|
-
memcpy(&obj->phdr[
|
1367
|
+
if (num_interesting_load_segments < obj->phdr.size()) {
|
1368
|
+
memcpy(&obj->phdr[num_interesting_load_segments++], &phdr, sizeof(phdr));
|
1345
1369
|
} else {
|
1346
1370
|
ABSL_RAW_LOG(
|
1347
|
-
WARNING, "%s: too many
|
1348
|
-
obj->filename,
|
1371
|
+
WARNING, "%s: too many interesting LOAD segments: %zu >= %zu",
|
1372
|
+
obj->filename, num_interesting_load_segments, obj->phdr.size());
|
1349
1373
|
break;
|
1350
1374
|
}
|
1351
1375
|
}
|
1352
|
-
if (
|
1353
|
-
// This object has no
|
1354
|
-
ABSL_RAW_LOG(WARNING, "%s: no
|
1376
|
+
if (num_interesting_load_segments == 0) {
|
1377
|
+
// This object has no interesting LOAD segments. That's unexpected.
|
1378
|
+
ABSL_RAW_LOG(WARNING, "%s: no interesting LOAD segments", obj->filename);
|
1355
1379
|
return false;
|
1356
1380
|
}
|
1357
1381
|
}
|
@@ -1379,8 +1403,8 @@ const char *Symbolizer::GetUncachedSymbol(const void *pc) {
|
|
1379
1403
|
// X in the file will have a start address of [true relocation]+X.
|
1380
1404
|
relocation = static_cast<ptrdiff_t>(start_addr - obj->offset);
|
1381
1405
|
|
1382
|
-
// Note: some binaries have multiple
|
1383
|
-
// find the right one.
|
1406
|
+
// Note: some binaries have multiple LOAD segments that can contain
|
1407
|
+
// function pointers. We must find the right one.
|
1384
1408
|
ElfW(Phdr) *phdr = nullptr;
|
1385
1409
|
for (size_t j = 0; j < obj->phdr.size(); j++) {
|
1386
1410
|
ElfW(Phdr) &p = obj->phdr[j];
|
@@ -1390,7 +1414,7 @@ const char *Symbolizer::GetUncachedSymbol(const void *pc) {
|
|
1390
1414
|
ABSL_RAW_CHECK(p.p_type == PT_NULL, "unexpected p_type");
|
1391
1415
|
break;
|
1392
1416
|
}
|
1393
|
-
if (pc < reinterpret_cast<void *>(start_addr + p.p_memsz)) {
|
1417
|
+
if (pc < reinterpret_cast<void *>(start_addr + p.p_vaddr + p.p_memsz)) {
|
1394
1418
|
phdr = &p;
|
1395
1419
|
break;
|
1396
1420
|
}
|
@@ -50,6 +50,9 @@ bool Symbolize(const void* pc, char* out, int out_size) {
|
|
50
50
|
if (!HaveOffsetConverter()) {
|
51
51
|
return false;
|
52
52
|
}
|
53
|
+
if (pc == nullptr || out_size <= 0) {
|
54
|
+
return false;
|
55
|
+
}
|
53
56
|
const char* func_name = emscripten_pc_get_function(pc);
|
54
57
|
if (func_name == nullptr) {
|
55
58
|
return false;
|
@@ -186,7 +186,7 @@ class CommandLineFlag {
|
|
186
186
|
// command line.
|
187
187
|
virtual bool IsSpecifiedOnCommandLine() const = 0;
|
188
188
|
|
189
|
-
// Validates supplied value
|
189
|
+
// Validates supplied value using validator or parseflag routine
|
190
190
|
virtual bool ValidateInputValue(absl::string_view value) const = 0;
|
191
191
|
|
192
192
|
// Checks that flags default value can be converted to string and back to the
|
@@ -197,7 +197,7 @@ void FlagImpl::AssertValidType(FlagFastTypeId rhs_type_id,
|
|
197
197
|
FlagFastTypeId lhs_type_id = flags_internal::FastTypeId(op_);
|
198
198
|
|
199
199
|
// `rhs_type_id` is the fast type id corresponding to the declaration
|
200
|
-
//
|
200
|
+
// visible at the call site. `lhs_type_id` is the fast type id
|
201
201
|
// corresponding to the type specified in flag definition. They must match
|
202
202
|
// for this operation to be well-defined.
|
203
203
|
if (ABSL_PREDICT_TRUE(lhs_type_id == rhs_type_id)) return;
|
@@ -238,7 +238,7 @@ void FlagImpl::StoreValue(const void* src) {
|
|
238
238
|
switch (ValueStorageKind()) {
|
239
239
|
case FlagValueStorageKind::kValueAndInitBit:
|
240
240
|
case FlagValueStorageKind::kOneWordAtomic: {
|
241
|
-
// Load the current value to avoid setting 'init' bit
|
241
|
+
// Load the current value to avoid setting 'init' bit manually.
|
242
242
|
int64_t one_word_val = OneWordValue().load(std::memory_order_acquire);
|
243
243
|
std::memcpy(&one_word_val, src, Sizeof(op_));
|
244
244
|
OneWordValue().store(one_word_val, std::memory_order_release);
|
@@ -121,7 +121,7 @@ inline void* Clone(FlagOpFn op, const void* obj) {
|
|
121
121
|
flags_internal::CopyConstruct(op, obj, res);
|
122
122
|
return res;
|
123
123
|
}
|
124
|
-
// Returns true if parsing of input text is
|
124
|
+
// Returns true if parsing of input text is successful.
|
125
125
|
inline bool Parse(FlagOpFn op, absl::string_view text, void* dst,
|
126
126
|
std::string* error) {
|
127
127
|
return op(FlagOp::kParse, &text, dst, error) != nullptr;
|
@@ -139,12 +139,12 @@ inline size_t Sizeof(FlagOpFn op) {
|
|
139
139
|
return static_cast<size_t>(reinterpret_cast<intptr_t>(
|
140
140
|
op(FlagOp::kSizeof, nullptr, nullptr, nullptr)));
|
141
141
|
}
|
142
|
-
// Returns fast type id
|
142
|
+
// Returns fast type id corresponding to the value type.
|
143
143
|
inline FlagFastTypeId FastTypeId(FlagOpFn op) {
|
144
144
|
return reinterpret_cast<FlagFastTypeId>(
|
145
145
|
op(FlagOp::kFastTypeId, nullptr, nullptr, nullptr));
|
146
146
|
}
|
147
|
-
// Returns fast type id
|
147
|
+
// Returns fast type id corresponding to the value type.
|
148
148
|
inline const std::type_info* RuntimeTypeId(FlagOpFn op) {
|
149
149
|
return reinterpret_cast<const std::type_info*>(
|
150
150
|
op(FlagOp::kRuntimeTypeId, nullptr, nullptr, nullptr));
|
@@ -223,12 +223,12 @@ extern const char kStrippedFlagHelp[];
|
|
223
223
|
// first overload if possible. If help message is evaluatable on constexpr
|
224
224
|
// context We'll be able to make FixedCharArray out of it and we'll choose first
|
225
225
|
// overload. In this case the help message expression is immediately evaluated
|
226
|
-
// and is used to construct the absl::Flag. No
|
226
|
+
// and is used to construct the absl::Flag. No additional code is generated by
|
227
227
|
// ABSL_FLAG Otherwise SFINAE kicks in and first overload is dropped from the
|
228
228
|
// consideration, in which case the second overload will be used. The second
|
229
229
|
// overload does not attempt to evaluate the help message expression
|
230
|
-
// immediately and instead delays the evaluation by
|
231
|
-
// pointer (&T::NonConst)
|
230
|
+
// immediately and instead delays the evaluation by returning the function
|
231
|
+
// pointer (&T::NonConst) generating the help message when necessary. This is
|
232
232
|
// evaluatable in constexpr context, but the cost is an extra function being
|
233
233
|
// generated in the ABSL_FLAG code.
|
234
234
|
template <typename Gen, size_t N>
|
@@ -308,19 +308,20 @@ constexpr int64_t UninitializedFlagValue() {
|
|
308
308
|
}
|
309
309
|
|
310
310
|
template <typename T>
|
311
|
-
using FlagUseValueAndInitBitStorage =
|
312
|
-
bool,
|
313
|
-
|
311
|
+
using FlagUseValueAndInitBitStorage =
|
312
|
+
std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
|
313
|
+
std::is_default_constructible<T>::value &&
|
314
|
+
(sizeof(T) < 8)>;
|
314
315
|
|
315
316
|
template <typename T>
|
316
|
-
using FlagUseOneWordStorage =
|
317
|
-
bool,
|
318
|
-
|
317
|
+
using FlagUseOneWordStorage =
|
318
|
+
std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
|
319
|
+
(sizeof(T) <= 8)>;
|
319
320
|
|
320
321
|
template <class T>
|
321
|
-
using FlagUseSequenceLockStorage =
|
322
|
-
bool,
|
323
|
-
|
322
|
+
using FlagUseSequenceLockStorage =
|
323
|
+
std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
|
324
|
+
(sizeof(T) > 8)>;
|
324
325
|
|
325
326
|
enum class FlagValueStorageKind : uint8_t {
|
326
327
|
kValueAndInitBit = 0,
|
@@ -29,7 +29,7 @@
|
|
29
29
|
// second level of protection is a global Mutex, so if two threads attempt to
|
30
30
|
// construct the flag concurrently only one wins.
|
31
31
|
//
|
32
|
-
// This solution is based on a
|
32
|
+
// This solution is based on a recommendation here:
|
33
33
|
// https://developercommunity.visualstudio.com/content/problem/336946/class-with-constexpr-constructor-not-using-static.html?childToView=648454#comment-648454
|
34
34
|
|
35
35
|
namespace flags_internal {
|
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
#include <cmath>
|
21
21
|
#include <limits>
|
22
|
+
#include <sstream>
|
22
23
|
#include <string>
|
23
24
|
#include <type_traits>
|
24
25
|
#include <vector>
|
@@ -26,6 +27,7 @@
|
|
26
27
|
#include "absl/base/config.h"
|
27
28
|
#include "absl/base/log_severity.h"
|
28
29
|
#include "absl/base/macros.h"
|
30
|
+
#include "absl/numeric/int128.h"
|
29
31
|
#include "absl/strings/ascii.h"
|
30
32
|
#include "absl/strings/match.h"
|
31
33
|
#include "absl/strings/numbers.h"
|
@@ -68,8 +70,10 @@ bool AbslParseFlag(absl::string_view text, bool* dst, std::string*) {
|
|
68
70
|
// puts us in base 16. But leading 0 does not put us in base 8. It
|
69
71
|
// caused too many bugs when we had that behavior.
|
70
72
|
static int NumericBase(absl::string_view text) {
|
71
|
-
|
72
|
-
|
73
|
+
if (text.empty()) return 0;
|
74
|
+
size_t num_start = (text[0] == '-' || text[0] == '+') ? 1 : 0;
|
75
|
+
const bool hex = (text.size() >= num_start + 2 && text[num_start] == '0' &&
|
76
|
+
(text[num_start + 1] == 'x' || text[num_start + 1] == 'X'));
|
73
77
|
return hex ? 16 : 10;
|
74
78
|
}
|
75
79
|
|
@@ -125,6 +129,32 @@ bool AbslParseFlag(absl::string_view text, unsigned long long* dst,
|
|
125
129
|
return ParseFlagImpl(text, *dst);
|
126
130
|
}
|
127
131
|
|
132
|
+
bool AbslParseFlag(absl::string_view text, absl::int128* dst, std::string*) {
|
133
|
+
text = absl::StripAsciiWhitespace(text);
|
134
|
+
|
135
|
+
// check hex
|
136
|
+
int base = NumericBase(text);
|
137
|
+
if (!absl::numbers_internal::safe_strto128_base(text, dst, base)) {
|
138
|
+
return false;
|
139
|
+
}
|
140
|
+
|
141
|
+
return base == 16 ? absl::SimpleHexAtoi(text, dst)
|
142
|
+
: absl::SimpleAtoi(text, dst);
|
143
|
+
}
|
144
|
+
|
145
|
+
bool AbslParseFlag(absl::string_view text, absl::uint128* dst, std::string*) {
|
146
|
+
text = absl::StripAsciiWhitespace(text);
|
147
|
+
|
148
|
+
// check hex
|
149
|
+
int base = NumericBase(text);
|
150
|
+
if (!absl::numbers_internal::safe_strtou128_base(text, dst, base)) {
|
151
|
+
return false;
|
152
|
+
}
|
153
|
+
|
154
|
+
return base == 16 ? absl::SimpleHexAtoi(text, dst)
|
155
|
+
: absl::SimpleAtoi(text, dst);
|
156
|
+
}
|
157
|
+
|
128
158
|
// --------------------------------------------------------------------
|
129
159
|
// AbslParseFlag for floating point types.
|
130
160
|
|
@@ -171,6 +201,17 @@ std::string Unparse(long v) { return absl::StrCat(v); }
|
|
171
201
|
std::string Unparse(unsigned long v) { return absl::StrCat(v); }
|
172
202
|
std::string Unparse(long long v) { return absl::StrCat(v); }
|
173
203
|
std::string Unparse(unsigned long long v) { return absl::StrCat(v); }
|
204
|
+
std::string Unparse(absl::int128 v) {
|
205
|
+
std::stringstream ss;
|
206
|
+
ss << v;
|
207
|
+
return ss.str();
|
208
|
+
}
|
209
|
+
std::string Unparse(absl::uint128 v) {
|
210
|
+
std::stringstream ss;
|
211
|
+
ss << v;
|
212
|
+
return ss.str();
|
213
|
+
}
|
214
|
+
|
174
215
|
template <typename T>
|
175
216
|
std::string UnparseFloatingPointVal(T v) {
|
176
217
|
// digits10 is guaranteed to roundtrip correctly in string -> value -> string
|
@@ -200,6 +200,7 @@
|
|
200
200
|
#define ABSL_FLAGS_MARSHALLING_H_
|
201
201
|
|
202
202
|
#include "absl/base/config.h"
|
203
|
+
#include "absl/numeric/int128.h"
|
203
204
|
|
204
205
|
#if defined(ABSL_HAVE_STD_OPTIONAL) && !defined(ABSL_USES_STD_OPTIONAL)
|
205
206
|
#include <optional>
|
@@ -233,6 +234,8 @@ bool AbslParseFlag(absl::string_view, unsigned long*, std::string*); // NOLINT
|
|
233
234
|
bool AbslParseFlag(absl::string_view, long long*, std::string*); // NOLINT
|
234
235
|
bool AbslParseFlag(absl::string_view, unsigned long long*, // NOLINT
|
235
236
|
std::string*);
|
237
|
+
bool AbslParseFlag(absl::string_view, absl::int128*, std::string*); // NOLINT
|
238
|
+
bool AbslParseFlag(absl::string_view, absl::uint128*, std::string*); // NOLINT
|
236
239
|
bool AbslParseFlag(absl::string_view, float*, std::string*);
|
237
240
|
bool AbslParseFlag(absl::string_view, double*, std::string*);
|
238
241
|
bool AbslParseFlag(absl::string_view, std::string*, std::string*);
|
@@ -310,6 +313,8 @@ std::string Unparse(long v); // NOLINT
|
|
310
313
|
std::string Unparse(unsigned long v); // NOLINT
|
311
314
|
std::string Unparse(long long v); // NOLINT
|
312
315
|
std::string Unparse(unsigned long long v); // NOLINT
|
316
|
+
std::string Unparse(absl::int128 v);
|
317
|
+
std::string Unparse(absl::uint128 v);
|
313
318
|
std::string Unparse(float v);
|
314
319
|
std::string Unparse(double v);
|
315
320
|
|
@@ -266,9 +266,17 @@ class AnyInvocable : private internal_any_invocable::Impl<Sig> {
|
|
266
266
|
// Exchanges the targets of `*this` and `other`.
|
267
267
|
void swap(AnyInvocable& other) noexcept { std::swap(*this, other); }
|
268
268
|
|
269
|
-
//
|
269
|
+
// absl::AnyInvocable::operator bool()
|
270
270
|
//
|
271
271
|
// Returns `true` if `*this` is not empty.
|
272
|
+
//
|
273
|
+
// WARNING: An `AnyInvocable` that wraps an empty `std::function` is not
|
274
|
+
// itself empty. This behavior is consistent with the standard equivalent
|
275
|
+
// `std::move_only_function`.
|
276
|
+
//
|
277
|
+
// In other words:
|
278
|
+
// std::function<void()> f; // empty
|
279
|
+
// absl::AnyInvocable<void()> a = std::move(f); // not empty
|
272
280
|
explicit operator bool() const noexcept { return this->HasValue(); }
|
273
281
|
|
274
282
|
// Invokes the target object of `*this`. `*this` must not be empty.
|
@@ -46,7 +46,7 @@ ABSL_NAMESPACE_BEGIN
|
|
46
46
|
//
|
47
47
|
// Like `std::bind()`, `absl::bind_front()` is implicitly convertible to
|
48
48
|
// `std::function`. In particular, it may be used as a simpler replacement for
|
49
|
-
// `std::bind()` in most cases, as it does not require
|
49
|
+
// `std::bind()` in most cases, as it does not require placeholders to be
|
50
50
|
// specified. More importantly, it provides more reliable correctness guarantees
|
51
51
|
// than `std::bind()`; while `std::bind()` will silently ignore passing more
|
52
52
|
// parameters than expected, for example, `absl::bind_front()` will report such
|
@@ -66,11 +66,11 @@ class FunctionRef;
|
|
66
66
|
|
67
67
|
// FunctionRef
|
68
68
|
//
|
69
|
-
// An `absl::FunctionRef` is a lightweight wrapper to any
|
69
|
+
// An `absl::FunctionRef` is a lightweight wrapper to any invocable object with
|
70
70
|
// a compatible signature. Generally, an `absl::FunctionRef` should only be used
|
71
71
|
// as an argument type and should be preferred as an argument over a const
|
72
72
|
// reference to a `std::function`. `absl::FunctionRef` itself does not allocate,
|
73
|
-
// although the wrapped
|
73
|
+
// although the wrapped invocable may.
|
74
74
|
//
|
75
75
|
// Example:
|
76
76
|
//
|
@@ -98,7 +98,7 @@ class FunctionRef<R(Args...)> {
|
|
98
98
|
std::is_convertible<FR, R>::value>::type;
|
99
99
|
|
100
100
|
public:
|
101
|
-
// Constructs a FunctionRef from any
|
101
|
+
// Constructs a FunctionRef from any invocable type.
|
102
102
|
template <typename F, typename = EnableIfCompatible<const F&>>
|
103
103
|
// NOLINTNEXTLINE(runtime/explicit)
|
104
104
|
FunctionRef(const F& f ABSL_ATTRIBUTE_LIFETIME_BOUND)
|
@@ -56,6 +56,7 @@
|
|
56
56
|
#include <cassert>
|
57
57
|
#include <cstddef>
|
58
58
|
#include <cstring>
|
59
|
+
#include <exception>
|
59
60
|
#include <functional>
|
60
61
|
#include <initializer_list>
|
61
62
|
#include <memory>
|
@@ -134,8 +135,16 @@ void InvokeR(F&& f, P&&... args) {
|
|
134
135
|
template <class ReturnType, class F, class... P,
|
135
136
|
absl::enable_if_t<!std::is_void<ReturnType>::value, int> = 0>
|
136
137
|
ReturnType InvokeR(F&& f, P&&... args) {
|
138
|
+
// GCC 12 has a false-positive -Wmaybe-uninitialized warning here.
|
139
|
+
#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
|
140
|
+
#pragma GCC diagnostic push
|
141
|
+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
142
|
+
#endif
|
137
143
|
return absl::base_internal::invoke(std::forward<F>(f),
|
138
144
|
std::forward<P>(args)...);
|
145
|
+
#if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
|
146
|
+
#pragma GCC diagnostic pop
|
147
|
+
#endif
|
139
148
|
}
|
140
149
|
|
141
150
|
//
|
@@ -196,7 +205,7 @@ union TypeErasedState {
|
|
196
205
|
template <class T>
|
197
206
|
T& ObjectInLocalStorage(TypeErasedState* const state) {
|
198
207
|
// We launder here because the storage may be reused with the same type.
|
199
|
-
#if
|
208
|
+
#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606L
|
200
209
|
return *std::launder(reinterpret_cast<T*>(&state->storage));
|
201
210
|
#elif ABSL_HAVE_BUILTIN(__builtin_launder)
|
202
211
|
return *__builtin_launder(reinterpret_cast<T*>(&state->storage));
|
@@ -431,11 +440,11 @@ class CoreImpl {
|
|
431
440
|
|
432
441
|
CoreImpl() noexcept : manager_(EmptyManager), invoker_(nullptr) {}
|
433
442
|
|
434
|
-
enum class TargetType
|
435
|
-
kPointer
|
436
|
-
kCompatibleAnyInvocable
|
437
|
-
kIncompatibleAnyInvocable
|
438
|
-
kOther
|
443
|
+
enum class TargetType {
|
444
|
+
kPointer,
|
445
|
+
kCompatibleAnyInvocable,
|
446
|
+
kIncompatibleAnyInvocable,
|
447
|
+
kOther,
|
439
448
|
};
|
440
449
|
|
441
450
|
// Note: QualDecayedTRef here includes the cv-ref qualifiers associated with
|
@@ -457,8 +466,7 @@ class CoreImpl {
|
|
457
466
|
// NOTE: We only use integers instead of enums as template parameters in
|
458
467
|
// order to work around a bug on C++14 under MSVC 2017.
|
459
468
|
// See b/236131881.
|
460
|
-
Initialize<
|
461
|
-
std::forward<F>(f));
|
469
|
+
Initialize<kTargetType, QualDecayedTRef>(std::forward<F>(f));
|
462
470
|
}
|
463
471
|
|
464
472
|
// Note: QualTRef here includes the cv-ref qualifiers associated with the
|
@@ -487,7 +495,7 @@ class CoreImpl {
|
|
487
495
|
// object.
|
488
496
|
Clear();
|
489
497
|
|
490
|
-
// Perform the actual move/
|
498
|
+
// Perform the actual move/destroy operation on the target function.
|
491
499
|
other.manager_(FunctionToCall::relocate_from_to, &other.state_, &state_);
|
492
500
|
manager_ = other.manager_;
|
493
501
|
invoker_ = other.invoker_;
|
@@ -509,8 +517,8 @@ class CoreImpl {
|
|
509
517
|
invoker_ = nullptr;
|
510
518
|
}
|
511
519
|
|
512
|
-
template <
|
513
|
-
absl::enable_if_t<target_type ==
|
520
|
+
template <TargetType target_type, class QualDecayedTRef, class F,
|
521
|
+
absl::enable_if_t<target_type == TargetType::kPointer, int> = 0>
|
514
522
|
void Initialize(F&& f) {
|
515
523
|
// This condition handles types that decay into pointers, which includes
|
516
524
|
// function references. Since function references cannot be null, GCC warns
|
@@ -534,8 +542,9 @@ class CoreImpl {
|
|
534
542
|
InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
|
535
543
|
}
|
536
544
|
|
537
|
-
template <
|
538
|
-
absl::enable_if_t<
|
545
|
+
template <TargetType target_type, class QualDecayedTRef, class F,
|
546
|
+
absl::enable_if_t<
|
547
|
+
target_type == TargetType::kCompatibleAnyInvocable, int> = 0>
|
539
548
|
void Initialize(F&& f) {
|
540
549
|
// In this case we can "steal the guts" of the other AnyInvocable.
|
541
550
|
f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
|
@@ -546,8 +555,9 @@ class CoreImpl {
|
|
546
555
|
f.invoker_ = nullptr;
|
547
556
|
}
|
548
557
|
|
549
|
-
template <
|
550
|
-
absl::enable_if_t<
|
558
|
+
template <TargetType target_type, class QualDecayedTRef, class F,
|
559
|
+
absl::enable_if_t<
|
560
|
+
target_type == TargetType::kIncompatibleAnyInvocable, int> = 0>
|
551
561
|
void Initialize(F&& f) {
|
552
562
|
if (f.HasValue()) {
|
553
563
|
InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
|
@@ -557,8 +567,8 @@ class CoreImpl {
|
|
557
567
|
}
|
558
568
|
}
|
559
569
|
|
560
|
-
template <
|
561
|
-
typename = absl::enable_if_t<target_type ==
|
570
|
+
template <TargetType target_type, class QualDecayedTRef, class F,
|
571
|
+
typename = absl::enable_if_t<target_type == TargetType::kOther>>
|
562
572
|
void Initialize(F&& f) {
|
563
573
|
InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
|
564
574
|
}
|
@@ -810,19 +820,22 @@ using CanAssignReferenceWrapper = TrueAlias<
|
|
810
820
|
: Core(absl::in_place_type<absl::decay_t<T> inv_quals>, \
|
811
821
|
std::forward<Args>(args)...) {} \
|
812
822
|
\
|
823
|
+
/*Raises a fatal error when the AnyInvocable is invoked after a move*/ \
|
824
|
+
static ReturnType InvokedAfterMove( \
|
825
|
+
TypeErasedState*, \
|
826
|
+
ForwardedParameterType<P>...) noexcept(noex) { \
|
827
|
+
ABSL_HARDENING_ASSERT(false && "AnyInvocable use-after-move"); \
|
828
|
+
std::terminate(); \
|
829
|
+
} \
|
830
|
+
\
|
813
831
|
InvokerType<noex, ReturnType, P...>* ExtractInvoker() cv { \
|
814
832
|
using QualifiedTestType = int cv ref; \
|
815
833
|
auto* invoker = this->invoker_; \
|
816
834
|
if (!std::is_const<QualifiedTestType>::value && \
|
817
835
|
std::is_rvalue_reference<QualifiedTestType>::value) { \
|
818
|
-
|
836
|
+
ABSL_ASSERT([this]() { \
|
819
837
|
/* We checked that this isn't const above, so const_cast is safe */ \
|
820
|
-
const_cast<Impl*>(this)->invoker_ =
|
821
|
-
[](TypeErasedState*, \
|
822
|
-
ForwardedParameterType<P>...) noexcept(noex) -> ReturnType { \
|
823
|
-
ABSL_HARDENING_ASSERT(false && "AnyInvocable use-after-move"); \
|
824
|
-
std::terminate(); \
|
825
|
-
}; \
|
838
|
+
const_cast<Impl*>(this)->invoker_ = InvokedAfterMove; \
|
826
839
|
return this->HasValue(); \
|
827
840
|
}()); \
|
828
841
|
} \
|
@@ -20,6 +20,7 @@
|
|
20
20
|
#include <type_traits>
|
21
21
|
|
22
22
|
#include "absl/base/internal/invoke.h"
|
23
|
+
#include "absl/functional/any_invocable.h"
|
23
24
|
#include "absl/meta/type_traits.h"
|
24
25
|
|
25
26
|
namespace absl {
|
@@ -40,18 +41,21 @@ union VoidPtr {
|
|
40
41
|
// Chooses the best type for passing T as an argument.
|
41
42
|
// Attempt to be close to SystemV AMD64 ABI. Objects with trivial copy ctor are
|
42
43
|
// passed by value.
|
44
|
+
template <typename T,
|
45
|
+
bool IsLValueReference = std::is_lvalue_reference<T>::value>
|
46
|
+
struct PassByValue : std::false_type {};
|
47
|
+
|
43
48
|
template <typename T>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
}
|
49
|
+
struct PassByValue<T, /*IsLValueReference=*/false>
|
50
|
+
: std::integral_constant<bool,
|
51
|
+
absl::is_trivially_copy_constructible<T>::value &&
|
52
|
+
absl::is_trivially_copy_assignable<
|
53
|
+
typename std::remove_cv<T>::type>::value &&
|
54
|
+
std::is_trivially_destructible<T>::value &&
|
55
|
+
sizeof(T) <= 2 * sizeof(void*)> {};
|
52
56
|
|
53
57
|
template <typename T>
|
54
|
-
struct ForwardT : std::conditional<PassByValue<T
|
58
|
+
struct ForwardT : std::conditional<PassByValue<T>::value, T, T&&> {};
|
55
59
|
|
56
60
|
// An Invoker takes a pointer to the type-erased invokable object, followed by
|
57
61
|
// the arguments that the invokable object expects.
|
@@ -87,6 +91,12 @@ void AssertNonNull(const std::function<Sig>& f) {
|
|
87
91
|
(void)f;
|
88
92
|
}
|
89
93
|
|
94
|
+
template <typename Sig>
|
95
|
+
void AssertNonNull(const AnyInvocable<Sig>& f) {
|
96
|
+
assert(f != nullptr);
|
97
|
+
(void)f;
|
98
|
+
}
|
99
|
+
|
90
100
|
template <typename F>
|
91
101
|
void AssertNonNull(const F&) {}
|
92
102
|
|
@@ -42,7 +42,7 @@
|
|
42
42
|
//
|
43
43
|
// `absl::Hash` may also produce different values from different dynamically
|
44
44
|
// loaded libraries. For this reason, `absl::Hash` values must never cross
|
45
|
-
//
|
45
|
+
// boundaries in dynamically loaded libraries (including when used in types like
|
46
46
|
// hash containers.)
|
47
47
|
//
|
48
48
|
// `absl::Hash` is intended to strongly mix input bits with a target of passing
|
@@ -110,9 +110,12 @@ ABSL_NAMESPACE_BEGIN
|
|
110
110
|
// * std::unique_ptr and std::shared_ptr
|
111
111
|
// * All string-like types including:
|
112
112
|
// * absl::Cord
|
113
|
-
// * std::string
|
114
|
-
//
|
115
|
-
//
|
113
|
+
// * std::string (as well as any instance of std::basic_string that
|
114
|
+
// uses one of {char, wchar_t, char16_t, char32_t} and its associated
|
115
|
+
// std::char_traits)
|
116
|
+
// * std::string_view (as well as any instance of std::basic_string_view
|
117
|
+
// that uses one of {char, wchar_t, char16_t, char32_t} and its associated
|
118
|
+
// std::char_traits)
|
116
119
|
// * All the standard sequence containers (provided the elements are hashable)
|
117
120
|
// * All the standard associative containers (provided the elements are
|
118
121
|
// hashable)
|