grpc 1.73.0 → 1.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +38 -17
- data/include/grpc/create_channel_from_endpoint.h +54 -0
- data/include/grpc/credentials.h +11 -5
- data/include/grpc/event_engine/event_engine.h +74 -17
- data/include/grpc/grpc_posix.h +20 -1
- data/include/grpc/impl/channel_arg_names.h +2 -4
- data/include/grpc/module.modulemap +1 -0
- data/include/grpc/support/json.h +24 -0
- data/src/core/call/interception_chain.h +7 -11
- data/src/core/channelz/channel_trace.cc +213 -115
- data/src/core/channelz/channel_trace.h +380 -86
- data/src/core/channelz/channelz.cc +270 -181
- data/src/core/channelz/channelz.h +168 -55
- data/src/core/channelz/channelz_registry.cc +2 -1
- data/src/core/channelz/channelz_registry.h +24 -0
- data/src/core/channelz/property_list.cc +357 -0
- data/src/core/channelz/property_list.h +202 -0
- data/src/core/channelz/ztrace_collector.h +3 -2
- data/src/core/client_channel/backup_poller.cc +17 -2
- data/src/core/client_channel/client_channel.cc +17 -28
- data/src/core/client_channel/client_channel_filter.cc +19 -29
- data/src/core/client_channel/config_selector.h +8 -2
- data/src/core/client_channel/dynamic_filters.cc +5 -6
- data/src/core/client_channel/dynamic_filters.h +1 -1
- data/src/core/client_channel/global_subchannel_pool.cc +4 -1
- data/src/core/client_channel/retry_filter.cc +21 -27
- data/src/core/client_channel/retry_filter.h +10 -7
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
- data/src/core/client_channel/retry_filter_legacy_call_data.h +1 -1
- data/src/core/client_channel/retry_interceptor.cc +30 -44
- data/src/core/client_channel/retry_interceptor.h +18 -17
- data/src/core/client_channel/retry_throttle.cc +46 -61
- data/src/core/client_channel/retry_throttle.h +17 -39
- data/src/core/client_channel/subchannel.cc +43 -19
- data/src/core/client_channel/subchannel.h +8 -0
- data/src/core/config/config_vars.cc +2 -0
- data/src/core/config/core_configuration.cc +1 -0
- data/src/core/config/core_configuration.h +11 -0
- data/src/core/credentials/call/call_creds_registry.h +125 -0
- data/src/core/credentials/call/call_creds_registry_init.cc +91 -0
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +6 -48
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +86 -0
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.h +74 -0
- data/src/core/credentials/call/jwt_util.cc +70 -0
- data/src/core/credentials/call/jwt_util.h +32 -0
- data/src/core/credentials/transport/channel_creds_registry_init.cc +1 -1
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +72 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +0 -1
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +1 -0
- data/src/core/credentials/transport/xds/xds_credentials.cc +0 -3
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +8 -8
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +16 -16
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -4
- data/src/core/ext/filters/http/message_compress/compression_filter.h +25 -22
- data/src/core/ext/filters/http/server/http_server_filter.h +12 -11
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +120 -35
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +162 -115
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +0 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +1239 -3514
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +1008 -1486
- data/src/core/ext/transport/chttp2/transport/flow_control.h +22 -17
- data/src/core/ext/transport/chttp2/transport/frame.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +299 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +11 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +12 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +1017 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +593 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -22
- data/{third_party/abseil-cpp/absl/strings/cord_buffer.cc → src/core/ext/transport/chttp2/transport/http2_stats_collector.cc} +14 -14
- data/src/core/ext/transport/chttp2/transport/http2_stats_collector.h +33 -0
- data/src/core/ext/transport/chttp2/transport/http2_status.h +6 -1
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +43 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +65 -0
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +0 -29
- data/src/core/ext/transport/chttp2/transport/internal.h +18 -8
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +105 -0
- data/src/core/ext/transport/chttp2/transport/keepalive.h +138 -0
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +185 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +19 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +151 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +180 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +5 -9
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +11 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +39 -1
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +19 -0
- data/src/core/ext/transport/chttp2/transport/transport_common.h +27 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +37 -11
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +571 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +120 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +1272 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +312 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +50 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +984 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +226 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +44 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +175 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +82 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +135 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +67 -0
- data/src/core/filter/auth/auth_filters.h +0 -25
- data/src/core/filter/auth/client_auth_filter.cc +0 -118
- data/src/core/filter/filter_args.h +9 -23
- data/src/core/handshaker/handshaker.cc +23 -14
- data/src/core/handshaker/handshaker.h +3 -0
- data/src/core/handshaker/http_connect/http_connect_handshaker.cc +3 -1
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +6 -5
- data/src/core/handshaker/security/secure_endpoint.cc +70 -25
- data/src/core/handshaker/security/security_handshaker.cc +4 -1
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +7 -1
- data/src/core/lib/channel/channel_args.cc +15 -0
- data/src/core/lib/channel/channel_args.h +3 -0
- data/src/core/lib/channel/channel_stack.cc +22 -23
- data/src/core/lib/channel/channel_stack.h +9 -7
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +2 -7
- data/src/core/lib/channel/promise_based_filter.h +5 -5
- data/src/core/lib/debug/trace_impl.h +0 -1
- data/src/core/lib/event_engine/ares_resolver.cc +165 -46
- data/src/core/lib/event_engine/ares_resolver.h +48 -2
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -4
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +2 -6
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.cc +40 -0
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.h +60 -0
- data/src/core/lib/event_engine/event_engine.cc +7 -0
- data/src/core/lib/event_engine/extensions/channelz.h +10 -6
- data/src/core/lib/event_engine/grpc_polled_fd.h +5 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +130 -162
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +11 -15
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +75 -117
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -9
- data/src/core/lib/event_engine/posix_engine/event_poller.h +18 -15
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +0 -18
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +124 -0
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.h +243 -0
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +29 -19
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +6 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +145 -92
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -19
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +333 -116
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +61 -18
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +45 -37
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +6 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +32 -142
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -5
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +211 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +1083 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +281 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.cc +154 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +174 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -719
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -170
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +33 -22
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +13 -11
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +117 -151
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +26 -94
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +26 -25
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +36 -62
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +7 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +12 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -1
- data/src/core/lib/event_engine/shim.cc +9 -0
- data/src/core/lib/event_engine/shim.h +3 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool.h +7 -3
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +0 -17
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +4 -2
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -2
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +4 -0
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +2 -6
- data/src/core/lib/event_engine/windows/windows_engine.cc +0 -1
- data/src/core/lib/event_engine/windows/windows_engine.h +1 -3
- data/src/core/lib/event_engine/windows/windows_listener.cc +14 -2
- data/src/core/lib/experiments/experiments.cc +45 -93
- data/src/core/lib/experiments/experiments.h +21 -51
- data/src/core/lib/iomgr/endpoint.cc +4 -3
- data/src/core/lib/iomgr/endpoint.h +7 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +7 -2
- data/src/core/lib/iomgr/ev_poll_posix.cc +7 -2
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +4 -6
- data/src/core/lib/iomgr/tcp_posix.cc +12 -6
- data/src/core/lib/iomgr/tcp_windows.cc +3 -2
- data/src/core/lib/promise/activity.h +1 -0
- data/src/core/lib/promise/arena_promise.h +23 -7
- data/src/core/lib/promise/detail/promise_factory.h +10 -0
- data/src/core/lib/promise/detail/promise_like.h +118 -11
- data/src/core/lib/promise/detail/promise_variant.h +50 -0
- data/src/core/lib/promise/detail/seq_state.h +687 -548
- data/src/core/lib/promise/if.h +20 -0
- data/src/core/lib/promise/inter_activity_latch.h +147 -0
- data/src/core/lib/promise/inter_activity_mutex.h +547 -0
- data/src/core/lib/promise/loop.h +65 -3
- data/src/core/lib/promise/map.h +24 -0
- data/src/core/lib/promise/match_promise.h +103 -0
- data/src/core/lib/promise/mpsc.cc +425 -0
- data/src/core/lib/promise/mpsc.h +490 -0
- data/src/core/lib/promise/party.cc +50 -1
- data/src/core/lib/promise/party.h +66 -1
- data/src/core/lib/promise/race.h +31 -0
- data/src/core/lib/promise/seq.h +4 -1
- data/src/core/lib/promise/status_flag.h +7 -0
- data/src/core/lib/promise/try_seq.h +4 -1
- data/src/core/lib/promise/wait_set.cc +28 -0
- data/src/core/lib/promise/wait_set.h +86 -0
- data/src/core/lib/resource_quota/arena.h +19 -0
- data/src/core/lib/slice/slice.h +5 -0
- data/src/core/lib/surface/channel_create.cc +88 -13
- data/src/core/lib/surface/channel_create.h +4 -0
- data/src/core/lib/surface/channel_init.cc +164 -47
- data/src/core/lib/surface/channel_init.h +64 -1
- data/src/core/lib/surface/filter_stack_call.cc +18 -9
- data/src/core/lib/surface/init.cc +6 -15
- data/src/core/lib/surface/legacy_channel.cc +3 -5
- data/src/core/lib/surface/legacy_channel.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +110 -0
- data/src/core/lib/transport/promise_endpoint.h +307 -0
- data/src/core/load_balancing/child_policy_handler.cc +2 -4
- data/src/core/load_balancing/delegating_helper.h +2 -3
- data/src/core/load_balancing/health_check_client.cc +1 -5
- data/src/core/load_balancing/lb_policy.h +1 -3
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +3 -0
- data/src/core/load_balancing/xds/cds.cc +10 -1
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
- data/src/core/resolver/xds/xds_config.cc +6 -3
- data/src/core/resolver/xds/xds_config.h +9 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +21 -6
- data/src/core/resolver/xds/xds_dependency_manager.h +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +31 -11
- data/src/core/server/server.cc +83 -12
- data/src/core/server/server.h +21 -2
- data/src/core/server/xds_server_config_fetcher.cc +63 -25
- data/src/core/service_config/service_config.h +1 -1
- data/src/core/service_config/service_config_impl.h +1 -1
- data/src/core/telemetry/context_list_entry.cc +38 -0
- data/src/core/telemetry/context_list_entry.h +42 -12
- data/src/core/telemetry/stats_data.cc +233 -207
- data/src/core/telemetry/stats_data.h +250 -153
- data/src/core/telemetry/tcp_tracer.h +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +11 -3
- data/src/core/tsi/fake_transport_security.cc +17 -0
- data/src/core/tsi/ssl_transport_security.cc +2 -0
- data/src/core/tsi/transport_security_grpc.cc +8 -0
- data/src/core/tsi/transport_security_grpc.h +15 -0
- data/src/core/util/backoff.cc +1 -5
- data/src/core/util/backoff.h +1 -0
- data/src/core/util/down_cast.h +1 -1
- data/src/core/util/function_signature.h +15 -1
- data/src/core/util/http_client/httpcli.cc +12 -5
- data/src/core/util/http_client/httpcli.h +4 -1
- data/src/core/util/latent_see.h +8 -5
- data/src/core/util/log.cc +4 -0
- data/src/core/util/memory_usage.h +268 -0
- data/src/core/util/per_cpu.cc +2 -0
- data/src/core/util/per_cpu.h +7 -0
- data/src/core/util/shared_bit_gen.h +20 -0
- data/src/core/util/single_set_ptr.h +2 -2
- data/src/core/util/upb_utils.h +42 -0
- data/src/core/util/uri.cc +3 -2
- data/src/core/util/useful.h +53 -2
- data/src/core/util/wait_for_single_owner.cc +31 -0
- data/src/core/util/wait_for_single_owner.h +24 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +5 -0
- data/src/core/xds/grpc/xds_client_grpc.cc +6 -2
- data/src/core/xds/grpc/xds_common_types_parser.cc +138 -50
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_filter.h +7 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +22 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -0
- data/src/core/xds/grpc/xds_route_config_parser.cc +15 -38
- data/src/core/xds/grpc/xds_server_grpc.cc +63 -13
- data/src/core/xds/grpc/xds_server_grpc.h +10 -2
- data/src/core/xds/grpc/xds_server_grpc_interface.h +4 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +18 -0
- data/src/core/xds/xds_client/xds_bootstrap.h +2 -0
- data/src/core/xds/xds_client/xds_client.cc +26 -5
- data/src/ruby/ext/grpc/extconf.rb +2 -0
- data/src/ruby/ext/grpc/rb_call.c +1 -8
- data/src/ruby/ext/grpc/rb_channel.c +72 -568
- data/src/ruby/ext/grpc/rb_channel.h +0 -3
- data/src/ruby/ext/grpc/rb_completion_queue.c +26 -14
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -7
- data/src/ruby/ext/grpc/rb_grpc.c +9 -5
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/ext/grpc/rb_loader.c +0 -4
- data/src/ruby/ext/grpc/rb_server.c +31 -50
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/core_spec.rb +22 -0
- data/src/ruby/spec/generic/active_call_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +2 -19
- data/third_party/abseil-cpp/absl/base/attributes.h +76 -7
- data/third_party/abseil-cpp/absl/base/call_once.h +11 -12
- data/third_party/abseil-cpp/absl/base/config.h +20 -129
- data/third_party/abseil-cpp/absl/base/{internal/fast_type_id.h → fast_type_id.h} +11 -16
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +0 -5
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +7 -7
- data/third_party/abseil-cpp/absl/base/internal/endian.h +34 -38
- data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +71 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -5
- data/third_party/abseil-cpp/absl/base/internal/{nullability_impl.h → nullability_deprecated.h} +45 -8
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +0 -9
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -13
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +6 -6
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +8 -3
- data/third_party/abseil-cpp/absl/base/no_destructor.h +11 -32
- data/third_party/abseil-cpp/absl/base/nullability.h +84 -72
- data/third_party/abseil-cpp/absl/base/options.h +3 -80
- data/third_party/abseil-cpp/absl/base/policy_checks.h +7 -7
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +1 -3
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -4
- data/third_party/abseil-cpp/absl/container/btree_map.h +4 -2
- data/third_party/abseil-cpp/absl/container/btree_set.h +4 -2
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -14
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -1
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +8 -5
- data/third_party/abseil-cpp/absl/container/internal/btree.h +132 -29
- data/third_party/abseil-cpp/absl/container/internal/btree_container.h +175 -71
- data/third_party/abseil-cpp/absl/container/internal/common.h +43 -0
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -2
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +9 -10
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +1 -8
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +0 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +20 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +31 -12
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +2 -7
- data/third_party/abseil-cpp/absl/container/internal/layout.h +26 -42
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +199 -68
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +1354 -183
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +881 -1424
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +80 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +0 -4
- data/third_party/abseil-cpp/absl/crc/crc32c.h +7 -5
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +0 -22
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +45 -74
- data/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +5 -5
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +8 -35
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +16 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +40 -37
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +16 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +14 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +10 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +27 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +13 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +4 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +15 -28
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +144 -27
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +73 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +25 -6
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/flag.h +4 -3
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +7 -6
- data/third_party/abseil-cpp/absl/flags/internal/registry.h +4 -3
- data/third_party/abseil-cpp/absl/flags/reflection.cc +2 -3
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +8 -10
- data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -9
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +110 -226
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +10 -12
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -5
- data/third_party/abseil-cpp/absl/hash/hash.h +18 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -5
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -61
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +25 -68
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +2 -6
- data/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
- data/third_party/abseil-cpp/absl/log/check.h +2 -1
- data/third_party/abseil-cpp/absl/log/globals.h +4 -5
- data/third_party/abseil-cpp/absl/log/internal/append_truncated.h +28 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +22 -22
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +65 -62
- data/third_party/abseil-cpp/absl/log/internal/conditions.cc +5 -3
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +7 -2
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +85 -43
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +84 -59
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -0
- data/third_party/abseil-cpp/absl/log/internal/proto.cc +3 -2
- data/third_party/abseil-cpp/absl/log/internal/proto.h +3 -3
- data/third_party/abseil-cpp/absl/log/internal/strip.h +4 -12
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +8 -6
- data/third_party/abseil-cpp/absl/log/internal/voidify.h +10 -4
- data/third_party/abseil-cpp/absl/log/log.h +48 -35
- data/third_party/abseil-cpp/absl/log/log_sink_registry.h +2 -2
- data/third_party/abseil-cpp/absl/meta/type_traits.h +46 -175
- data/third_party/abseil-cpp/absl/numeric/bits.h +68 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -52
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +7 -3
- data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +1 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +10 -11
- data/third_party/abseil-cpp/absl/random/distributions.h +6 -8
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/{pool_urbg.cc → entropy_pool.cc} +22 -90
- data/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +1 -1
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +20 -12
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +5 -5
- data/third_party/abseil-cpp/absl/random/random.h +88 -53
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +6 -2
- data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +3 -4
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +3 -4
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -3
- data/third_party/abseil-cpp/absl/status/status.cc +4 -8
- data/third_party/abseil-cpp/absl/status/status.h +8 -8
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.cc +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +6 -6
- data/third_party/abseil-cpp/absl/strings/ascii.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/ascii.h +18 -18
- data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -22
- data/third_party/abseil-cpp/absl/strings/charconv.h +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +54 -58
- data/third_party/abseil-cpp/absl/strings/cord.h +94 -83
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +11 -11
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +3 -3
- data/third_party/abseil-cpp/absl/strings/escaping.cc +130 -149
- data/third_party/abseil-cpp/absl/strings/escaping.h +9 -10
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +6 -8
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +7 -63
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +0 -22
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +5 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +0 -5
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +96 -1
- data/third_party/abseil-cpp/absl/strings/internal/utf8.h +15 -1
- data/third_party/abseil-cpp/absl/strings/numbers.cc +53 -32
- data/third_party/abseil-cpp/absl/strings/numbers.h +87 -58
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +6 -7
- data/third_party/abseil-cpp/absl/strings/str_cat.h +32 -32
- data/third_party/abseil-cpp/absl/strings/str_format.h +18 -18
- data/third_party/abseil-cpp/absl/strings/str_replace.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/str_replace.h +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.cc +4 -9
- data/third_party/abseil-cpp/absl/strings/string_view.h +27 -32
- data/third_party/abseil-cpp/absl/strings/strip.h +4 -4
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -4
- data/third_party/abseil-cpp/absl/strings/substitute.h +66 -64
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +0 -5
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +97 -69
- data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +12 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +90 -111
- data/third_party/abseil-cpp/absl/time/time.h +20 -15
- data/third_party/abseil-cpp/absl/types/optional.h +7 -747
- data/third_party/abseil-cpp/absl/types/span.h +13 -11
- data/third_party/abseil-cpp/absl/types/variant.h +5 -784
- data/third_party/abseil-cpp/absl/utility/utility.h +10 -185
- metadata +72 -20
- data/src/core/lib/event_engine/forkable.cc +0 -105
- data/src/core/lib/event_engine/forkable.h +0 -67
- data/src/core/lib/iomgr/python_util.h +0 -46
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +0 -108
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +0 -241
- data/third_party/abseil-cpp/absl/log/log_entry.cc +0 -41
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +0 -131
- data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +0 -66
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +0 -78
- data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +0 -82
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +0 -82
- data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -352
- data/third_party/abseil-cpp/absl/types/internal/variant.h +0 -1622
@@ -33,6 +33,7 @@
|
|
33
33
|
#include "absl/base/macros.h"
|
34
34
|
#include "absl/base/port.h"
|
35
35
|
#include "absl/debugging/internal/address_is_readable.h"
|
36
|
+
#include "absl/debugging/internal/addresses.h"
|
36
37
|
#include "absl/debugging/internal/vdso_support.h" // a no-op on non-elf or non-glibc systems
|
37
38
|
#include "absl/debugging/stacktrace.h"
|
38
39
|
|
@@ -163,6 +164,7 @@ static uintptr_t GetFP(const void *vuc) {
|
|
163
164
|
template <bool STRICT_UNWINDING, bool WITH_CONTEXT>
|
164
165
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
165
166
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
167
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
166
168
|
static void **NextStackFrame(void **old_fp, const void *uc,
|
167
169
|
size_t stack_low, size_t stack_high) {
|
168
170
|
void **new_fp = (void **)*old_fp;
|
@@ -326,9 +328,11 @@ static void **NextStackFrame(void **old_fp, const void *uc,
|
|
326
328
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
327
329
|
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
|
328
330
|
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
|
331
|
+
ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // May read random elements from stack.
|
329
332
|
ABSL_ATTRIBUTE_NOINLINE
|
330
|
-
static int UnwindImpl(void **result,
|
331
|
-
const void *ucp,
|
333
|
+
static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
334
|
+
int max_depth, int skip_count, const void *ucp,
|
335
|
+
int *min_dropped_frames) {
|
332
336
|
int n = 0;
|
333
337
|
void **fp = reinterpret_cast<void **>(__builtin_frame_address(0));
|
334
338
|
|
@@ -349,13 +353,19 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
|
|
349
353
|
} else {
|
350
354
|
result[n] = *(fp + 1);
|
351
355
|
if (IS_STACK_FRAMES) {
|
352
|
-
if (
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
356
|
+
if (frames) {
|
357
|
+
frames[n] = absl::debugging_internal::StripPointerMetadata(fp) +
|
358
|
+
2 * sizeof(void *) /* go past the return address */;
|
359
|
+
}
|
360
|
+
if (sizes) {
|
361
|
+
if (next_fp > fp) {
|
362
|
+
sizes[n] = static_cast<int>(
|
363
|
+
absl::debugging_internal::StripPointerMetadata(next_fp) -
|
364
|
+
absl::debugging_internal::StripPointerMetadata(fp));
|
365
|
+
} else {
|
366
|
+
// A frame-size of 0 is used to indicate unknown frame size.
|
367
|
+
sizes[n] = 0;
|
368
|
+
}
|
359
369
|
}
|
360
370
|
}
|
361
371
|
n++;
|
@@ -36,12 +36,42 @@
|
|
36
36
|
|
37
37
|
#include "absl/debugging/stacktrace.h"
|
38
38
|
|
39
|
+
#include <stddef.h>
|
40
|
+
#include <stdint.h>
|
41
|
+
|
42
|
+
#include <algorithm>
|
39
43
|
#include <atomic>
|
40
44
|
|
41
45
|
#include "absl/base/attributes.h"
|
46
|
+
#include "absl/base/config.h"
|
47
|
+
#include "absl/base/optimization.h"
|
42
48
|
#include "absl/base/port.h"
|
43
49
|
#include "absl/debugging/internal/stacktrace_config.h"
|
44
50
|
|
51
|
+
#ifdef ABSL_INTERNAL_HAVE_ALLOCA
|
52
|
+
#error ABSL_INTERNAL_HAVE_ALLOCA cannot be directly set
|
53
|
+
#endif
|
54
|
+
|
55
|
+
#ifdef _WIN32
|
56
|
+
#include <malloc.h>
|
57
|
+
#define ABSL_INTERNAL_HAVE_ALLOCA 1
|
58
|
+
#else
|
59
|
+
#ifdef __has_include
|
60
|
+
#if __has_include(<alloca.h>)
|
61
|
+
#include <alloca.h>
|
62
|
+
#define ABSL_INTERNAL_HAVE_ALLOCA 1
|
63
|
+
#elif !defined(alloca)
|
64
|
+
static void* alloca(size_t) noexcept { return nullptr; }
|
65
|
+
#endif
|
66
|
+
#endif
|
67
|
+
#endif
|
68
|
+
|
69
|
+
#ifdef ABSL_INTERNAL_HAVE_ALLOCA
|
70
|
+
static constexpr bool kHaveAlloca = true;
|
71
|
+
#else
|
72
|
+
static constexpr bool kHaveAlloca = false;
|
73
|
+
#endif
|
74
|
+
|
45
75
|
#if defined(ABSL_STACKTRACE_INL_HEADER)
|
46
76
|
#include ABSL_STACKTRACE_INL_HEADER
|
47
77
|
#else
|
@@ -66,59 +96,111 @@ typedef int (*Unwinder)(void**, int*, int, int, const void*, int*);
|
|
66
96
|
std::atomic<Unwinder> custom;
|
67
97
|
|
68
98
|
template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
|
69
|
-
ABSL_ATTRIBUTE_ALWAYS_INLINE inline int Unwind(void** result,
|
70
|
-
int
|
71
|
-
const void* uc,
|
99
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE inline int Unwind(void** result, uintptr_t* frames,
|
100
|
+
int* sizes, int max_depth,
|
101
|
+
int skip_count, const void* uc,
|
72
102
|
int* min_dropped_frames) {
|
73
|
-
Unwinder f = &UnwindImpl<IS_STACK_FRAMES, IS_WITH_CONTEXT>;
|
74
103
|
Unwinder g = custom.load(std::memory_order_acquire);
|
75
|
-
|
76
|
-
|
104
|
+
int size;
|
77
105
|
// Add 1 to skip count for the unwinder function itself
|
78
|
-
|
79
|
-
|
80
|
-
|
106
|
+
++skip_count;
|
107
|
+
if (g != nullptr) {
|
108
|
+
size = (*g)(result, sizes, max_depth, skip_count, uc, min_dropped_frames);
|
109
|
+
// Frame pointers aren't returned by existing hooks, so clear them.
|
110
|
+
if (frames != nullptr) {
|
111
|
+
std::fill(frames, frames + size, uintptr_t());
|
112
|
+
}
|
113
|
+
} else {
|
114
|
+
size = UnwindImpl<IS_STACK_FRAMES, IS_WITH_CONTEXT>(
|
115
|
+
result, frames, sizes, max_depth, skip_count, uc, min_dropped_frames);
|
116
|
+
}
|
81
117
|
ABSL_BLOCK_TAIL_CALL_OPTIMIZATION();
|
82
118
|
return size;
|
83
119
|
}
|
84
120
|
|
85
121
|
} // anonymous namespace
|
86
122
|
|
87
|
-
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int
|
88
|
-
|
89
|
-
|
90
|
-
|
123
|
+
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int
|
124
|
+
internal_stacktrace::GetStackFrames(void** result, uintptr_t* frames,
|
125
|
+
int* sizes, int max_depth, int skip_count) {
|
126
|
+
if (internal_stacktrace::ShouldFixUpStack()) {
|
127
|
+
size_t depth = static_cast<size_t>(Unwind<true, true>(
|
128
|
+
result, frames, sizes, max_depth, skip_count, nullptr, nullptr));
|
129
|
+
internal_stacktrace::FixUpStack(result, frames, sizes,
|
130
|
+
static_cast<size_t>(max_depth), depth);
|
131
|
+
return static_cast<int>(depth);
|
132
|
+
}
|
133
|
+
|
134
|
+
return Unwind<true, false>(result, frames, sizes, max_depth, skip_count,
|
135
|
+
nullptr, nullptr);
|
91
136
|
}
|
92
137
|
|
93
138
|
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int
|
94
|
-
GetStackFramesWithContext(void** result,
|
95
|
-
|
96
|
-
|
97
|
-
|
139
|
+
internal_stacktrace::GetStackFramesWithContext(void** result, uintptr_t* frames,
|
140
|
+
int* sizes, int max_depth,
|
141
|
+
int skip_count, const void* uc,
|
142
|
+
int* min_dropped_frames) {
|
143
|
+
if (internal_stacktrace::ShouldFixUpStack()) {
|
144
|
+
size_t depth = static_cast<size_t>(Unwind<true, true>(
|
145
|
+
result, frames, sizes, max_depth, skip_count, uc, min_dropped_frames));
|
146
|
+
internal_stacktrace::FixUpStack(result, frames, sizes,
|
147
|
+
static_cast<size_t>(max_depth), depth);
|
148
|
+
return static_cast<int>(depth);
|
149
|
+
}
|
150
|
+
|
151
|
+
return Unwind<true, true>(result, frames, sizes, max_depth, skip_count, uc,
|
98
152
|
min_dropped_frames);
|
99
153
|
}
|
100
154
|
|
101
155
|
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int GetStackTrace(
|
102
156
|
void** result, int max_depth, int skip_count) {
|
103
|
-
|
104
|
-
|
157
|
+
if (internal_stacktrace::ShouldFixUpStack()) {
|
158
|
+
if constexpr (kHaveAlloca) {
|
159
|
+
const size_t nmax = static_cast<size_t>(max_depth);
|
160
|
+
uintptr_t* frames =
|
161
|
+
static_cast<uintptr_t*>(alloca(nmax * sizeof(*frames)));
|
162
|
+
int* sizes = static_cast<int*>(alloca(nmax * sizeof(*sizes)));
|
163
|
+
size_t depth = static_cast<size_t>(Unwind<true, false>(
|
164
|
+
result, frames, sizes, max_depth, skip_count, nullptr, nullptr));
|
165
|
+
internal_stacktrace::FixUpStack(result, frames, sizes, nmax, depth);
|
166
|
+
return static_cast<int>(depth);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
return Unwind<false, false>(result, nullptr, nullptr, max_depth, skip_count,
|
171
|
+
nullptr, nullptr);
|
105
172
|
}
|
106
173
|
|
107
174
|
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int
|
108
175
|
GetStackTraceWithContext(void** result, int max_depth, int skip_count,
|
109
176
|
const void* uc, int* min_dropped_frames) {
|
110
|
-
|
111
|
-
|
177
|
+
if (internal_stacktrace::ShouldFixUpStack()) {
|
178
|
+
if constexpr (kHaveAlloca) {
|
179
|
+
const size_t nmax = static_cast<size_t>(max_depth);
|
180
|
+
uintptr_t* frames =
|
181
|
+
static_cast<uintptr_t*>(alloca(nmax * sizeof(*frames)));
|
182
|
+
int* sizes = static_cast<int*>(alloca(nmax * sizeof(*sizes)));
|
183
|
+
size_t depth = static_cast<size_t>(
|
184
|
+
Unwind<true, true>(result, frames, sizes, max_depth, skip_count, uc,
|
185
|
+
min_dropped_frames));
|
186
|
+
internal_stacktrace::FixUpStack(result, frames, sizes, nmax, depth);
|
187
|
+
return static_cast<int>(depth);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
|
191
|
+
return Unwind<false, true>(result, nullptr, nullptr, max_depth, skip_count,
|
192
|
+
uc, min_dropped_frames);
|
112
193
|
}
|
113
194
|
|
114
195
|
void SetStackUnwinder(Unwinder w) {
|
115
196
|
custom.store(w, std::memory_order_release);
|
116
197
|
}
|
117
198
|
|
118
|
-
|
119
|
-
|
199
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE static inline int DefaultStackUnwinderImpl(
|
200
|
+
void** pcs, uintptr_t* frames, int* sizes, int depth, int skip,
|
201
|
+
const void* uc, int* min_dropped_frames) {
|
120
202
|
skip++; // For this function
|
121
|
-
|
203
|
+
decltype(&UnwindImpl<false, false>) f;
|
122
204
|
if (sizes == nullptr) {
|
123
205
|
if (uc == nullptr) {
|
124
206
|
f = &UnwindImpl<false, false>;
|
@@ -132,11 +214,46 @@ int DefaultStackUnwinder(void** pcs, int* sizes, int depth, int skip,
|
|
132
214
|
f = &UnwindImpl<true, true>;
|
133
215
|
}
|
134
216
|
}
|
135
|
-
|
136
|
-
|
137
|
-
|
217
|
+
return (*f)(pcs, frames, sizes, depth, skip, uc, min_dropped_frames);
|
218
|
+
}
|
219
|
+
|
220
|
+
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int
|
221
|
+
internal_stacktrace::DefaultStackUnwinder(void** pcs, uintptr_t* frames,
|
222
|
+
int* sizes, int depth, int skip,
|
223
|
+
const void* uc,
|
224
|
+
int* min_dropped_frames) {
|
225
|
+
int n = DefaultStackUnwinderImpl(pcs, frames, sizes, depth, skip, uc,
|
226
|
+
min_dropped_frames);
|
227
|
+
ABSL_BLOCK_TAIL_CALL_OPTIMIZATION();
|
228
|
+
return n;
|
229
|
+
}
|
230
|
+
|
231
|
+
ABSL_ATTRIBUTE_NOINLINE ABSL_ATTRIBUTE_NO_TAIL_CALL int DefaultStackUnwinder(
|
232
|
+
void** pcs, int* sizes, int depth, int skip, const void* uc,
|
233
|
+
int* min_dropped_frames) {
|
234
|
+
int n = DefaultStackUnwinderImpl(pcs, nullptr, sizes, depth, skip, uc,
|
235
|
+
min_dropped_frames);
|
236
|
+
ABSL_BLOCK_TAIL_CALL_OPTIMIZATION();
|
138
237
|
return n;
|
139
238
|
}
|
140
239
|
|
240
|
+
ABSL_ATTRIBUTE_WEAK bool internal_stacktrace::ShouldFixUpStack() {
|
241
|
+
return false;
|
242
|
+
}
|
243
|
+
|
244
|
+
// Fixes up the stack trace of the current thread, in the first `depth` frames
|
245
|
+
// of each buffer. The buffers need to be larger than `depth`, to accommodate
|
246
|
+
// any newly inserted elements. `depth` is updated to reflect the new number of
|
247
|
+
// elements valid across all the buffers. (It is therefore recommended that all
|
248
|
+
// buffer sizes be equal.)
|
249
|
+
//
|
250
|
+
// The `frames` and `sizes` parameters denote the bounds of the stack frame
|
251
|
+
// corresponding to each instruction pointer in the `pcs`.
|
252
|
+
// Any elements inside these buffers may be zero or null, in which case that
|
253
|
+
// information is assumed to be absent/unavailable.
|
254
|
+
ABSL_ATTRIBUTE_WEAK void internal_stacktrace::FixUpStack(void**, uintptr_t*,
|
255
|
+
int*, size_t,
|
256
|
+
size_t&) {}
|
257
|
+
|
141
258
|
ABSL_NAMESPACE_END
|
142
259
|
} // namespace absl
|
@@ -31,11 +31,53 @@
|
|
31
31
|
#ifndef ABSL_DEBUGGING_STACKTRACE_H_
|
32
32
|
#define ABSL_DEBUGGING_STACKTRACE_H_
|
33
33
|
|
34
|
+
#include <stddef.h>
|
35
|
+
#include <stdint.h>
|
36
|
+
|
37
|
+
#include "absl/base/attributes.h"
|
34
38
|
#include "absl/base/config.h"
|
35
39
|
|
36
40
|
namespace absl {
|
37
41
|
ABSL_NAMESPACE_BEGIN
|
38
42
|
|
43
|
+
namespace internal_stacktrace {
|
44
|
+
|
45
|
+
// Same as `absl::GetStackFrames`, but with an optional `frames` parameter to
|
46
|
+
// allow callers to receive the raw stack frame addresses.
|
47
|
+
// This is internal for now; use `absl::GetStackFrames()` instead.
|
48
|
+
extern int GetStackFrames(void** result, uintptr_t* frames, int* sizes,
|
49
|
+
int max_depth, int skip_count);
|
50
|
+
|
51
|
+
// Same as `absl::GetStackFramesWithContext`, but with an optional `frames`
|
52
|
+
// parameter to allow callers to receive a start address for each stack frame.
|
53
|
+
// The address may be zero in cases where it cannot be computed.
|
54
|
+
//
|
55
|
+
// DO NOT use this function without consulting the owners of absl/debuggging.
|
56
|
+
// There is NO GUARANTEE on the precise frame addresses returned on any given
|
57
|
+
// platform. It is only intended to provide sufficient non-overlapping bounds on
|
58
|
+
// the local variables of a stack frame when used in conjunction with the
|
59
|
+
// returned frame sizes. The actual pointers may be ABI-dependent, may vary at
|
60
|
+
// run time, and are subject to breakage without notice.
|
61
|
+
//
|
62
|
+
// Implementation note:
|
63
|
+
// Currently, we *attempt* to return the Canonical Frame Address (CFA) in DWARF
|
64
|
+
// on most platforms. This is the value of the stack pointer just before the
|
65
|
+
// 'call' instruction is executed in the caller.
|
66
|
+
// Not all platforms and toolchains support this exact address, so this should
|
67
|
+
// not be relied on for correctness.
|
68
|
+
extern int GetStackFramesWithContext(void** result, uintptr_t* frames,
|
69
|
+
int* sizes, int max_depth, int skip_count,
|
70
|
+
const void* uc, int* min_dropped_frames);
|
71
|
+
|
72
|
+
// Same as `absl::DefaultStackUnwinder`, but with an optional `frames` parameter
|
73
|
+
// to allow callers to receive the raw stack frame addresses.
|
74
|
+
// This is internal for now; do not depend on this externally.
|
75
|
+
extern int DefaultStackUnwinder(void** pcs, uintptr_t* frames, int* sizes,
|
76
|
+
int max_depth, int skip_count, const void* uc,
|
77
|
+
int* min_dropped_frames);
|
78
|
+
|
79
|
+
} // namespace internal_stacktrace
|
80
|
+
|
39
81
|
// GetStackFrames()
|
40
82
|
//
|
41
83
|
// Records program counter values for up to `max_depth` frames, skipping the
|
@@ -78,8 +120,13 @@ ABSL_NAMESPACE_BEGIN
|
|
78
120
|
//
|
79
121
|
// This routine may return fewer stack frame entries than are
|
80
122
|
// available. Also note that `result` and `sizes` must both be non-null.
|
81
|
-
|
82
|
-
|
123
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE inline int GetStackFrames(void** result,
|
124
|
+
int* sizes,
|
125
|
+
int max_depth,
|
126
|
+
int skip_count) {
|
127
|
+
return internal_stacktrace::GetStackFrames(result, nullptr, sizes, max_depth,
|
128
|
+
skip_count);
|
129
|
+
}
|
83
130
|
|
84
131
|
// GetStackFramesWithContext()
|
85
132
|
//
|
@@ -102,9 +149,12 @@ extern int GetStackFrames(void** result, int* sizes, int max_depth,
|
|
102
149
|
// or other reasons. (This value will be set to `0` if no frames were dropped.)
|
103
150
|
// The number of total stack frames is guaranteed to be >= skip_count +
|
104
151
|
// max_depth + *min_dropped_frames.
|
105
|
-
|
106
|
-
|
107
|
-
|
152
|
+
ABSL_ATTRIBUTE_ALWAYS_INLINE inline int GetStackFramesWithContext(
|
153
|
+
void** result, int* sizes, int max_depth, int skip_count, const void* uc,
|
154
|
+
int* min_dropped_frames) {
|
155
|
+
return internal_stacktrace::GetStackFramesWithContext(
|
156
|
+
result, nullptr, sizes, max_depth, skip_count, uc, min_dropped_frames);
|
157
|
+
}
|
108
158
|
|
109
159
|
// GetStackTrace()
|
110
160
|
//
|
@@ -225,6 +275,24 @@ namespace debugging_internal {
|
|
225
275
|
// working.
|
226
276
|
extern bool StackTraceWorksForTest();
|
227
277
|
} // namespace debugging_internal
|
278
|
+
|
279
|
+
namespace internal_stacktrace {
|
280
|
+
extern bool ShouldFixUpStack();
|
281
|
+
|
282
|
+
// Fixes up the stack trace of the current thread, in the first `depth` frames
|
283
|
+
// of each buffer. The buffers need to be larger than `depth`, to accommodate
|
284
|
+
// any newly inserted elements. `depth` is updated to reflect the new number of
|
285
|
+
// elements valid across all the buffers. (It is therefore recommended that all
|
286
|
+
// buffer sizes be equal.)
|
287
|
+
//
|
288
|
+
// The `frames` and `sizes` parameters denote the bounds of the stack frame
|
289
|
+
// corresponding to each instruction pointer in the `pcs`.
|
290
|
+
// Any elements inside these buffers may be zero or null, in which case that
|
291
|
+
// information is assumed to be absent/unavailable.
|
292
|
+
extern void FixUpStack(void** pcs, uintptr_t* frames, int* sizes,
|
293
|
+
size_t capacity, size_t& depth);
|
294
|
+
} // namespace internal_stacktrace
|
295
|
+
|
228
296
|
ABSL_NAMESPACE_END
|
229
297
|
} // namespace absl
|
230
298
|
|
@@ -125,12 +125,20 @@ namespace {
|
|
125
125
|
// Some platforms use a special .opd section to store function pointers.
|
126
126
|
const char kOpdSectionName[] = ".opd";
|
127
127
|
|
128
|
-
#if
|
128
|
+
#if defined(__powerpc64__) && defined(_CALL_ELF)
|
129
|
+
#if _CALL_ELF <= 1
|
130
|
+
#define ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI 1
|
131
|
+
#endif
|
132
|
+
#endif
|
133
|
+
#if defined(ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI) || defined(__ia64)
|
129
134
|
// Use opd section for function descriptors on these platforms, the function
|
130
135
|
// address is the first word of the descriptor.
|
131
|
-
|
132
|
-
|
133
|
-
|
136
|
+
//
|
137
|
+
// https://maskray.me/blog/2023-02-26-linker-notes-on-power-isa notes that
|
138
|
+
// opd sections are used on 64-bit PowerPC with the ELFv1 ABI.
|
139
|
+
inline constexpr bool kPlatformUsesOPDSections = true;
|
140
|
+
#else
|
141
|
+
inline constexpr bool kPlatformUsesOPDSections = false;
|
134
142
|
#endif
|
135
143
|
|
136
144
|
// This works for PowerPC & IA64 only. A function descriptor consist of two
|
@@ -1451,11 +1459,11 @@ static bool MaybeInitializeObjFile(ObjFile *obj) {
|
|
1451
1459
|
}
|
1452
1460
|
phoff += phentsize;
|
1453
1461
|
|
1454
|
-
#
|
1455
|
-
// On the PowerPC
|
1456
|
-
// descriptors. These descriptors are stored in an .opd section,
|
1457
|
-
// mapped read-only. We thus need to look at all readable
|
1458
|
-
// just the executable ones.
|
1462
|
+
#ifdef ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI
|
1463
|
+
// On the PowerPC 64-bit ELFv1 ABI, function pointers actually point to
|
1464
|
+
// function descriptors. These descriptors are stored in an .opd section,
|
1465
|
+
// which is mapped read-only. We thus need to look at all readable
|
1466
|
+
// segments, not just the executable ones.
|
1459
1467
|
constexpr int interesting = PF_R;
|
1460
1468
|
#else
|
1461
1469
|
constexpr int interesting = PF_X | PF_R;
|
@@ -1762,3 +1770,5 @@ extern "C" bool AbslInternalGetFileMappingHint(const void **start,
|
|
1762
1770
|
return absl::debugging_internal::GetFileMappingHint(start, end, offset,
|
1763
1771
|
filename);
|
1764
1772
|
}
|
1773
|
+
|
1774
|
+
#undef ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI
|
@@ -58,12 +58,13 @@ bool Symbolize(const void* pc, char* out, int out_size) {
|
|
58
58
|
return false;
|
59
59
|
}
|
60
60
|
|
61
|
-
strncpy(out, func_name, out_size);
|
61
|
+
strncpy(out, func_name, static_cast<size_t>(out_size));
|
62
62
|
|
63
63
|
if (out[out_size - 1] != '\0') {
|
64
64
|
// strncpy() does not '\0' terminate when it truncates.
|
65
65
|
static constexpr char kEllipsis[] = "...";
|
66
|
-
|
66
|
+
size_t ellipsis_size =
|
67
|
+
std::min(sizeof(kEllipsis) - 1, static_cast<size_t>(out_size) - 1);
|
67
68
|
memcpy(out + out_size - ellipsis_size - 1, kEllipsis, ellipsis_size);
|
68
69
|
out[out_size - 1] = '\0';
|
69
70
|
}
|
@@ -15,7 +15,9 @@
|
|
15
15
|
// See "Retrieving Symbol Information by Address":
|
16
16
|
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680578(v=vs.85).aspx
|
17
17
|
|
18
|
+
#include <ntstatus.h>
|
18
19
|
#include <windows.h>
|
20
|
+
#include <winternl.h>
|
19
21
|
|
20
22
|
// MSVC header dbghelp.h has a warning for an ignored typedef.
|
21
23
|
#pragma warning(push)
|
@@ -45,13 +47,30 @@ void InitializeSymbolizer(const char*) {
|
|
45
47
|
// symbols be loaded. This is the fastest, most efficient way to use
|
46
48
|
// the symbol handler.
|
47
49
|
SymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME);
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
DWORD syminitialize_error;
|
51
|
+
constexpr int kSymInitializeRetries = 5;
|
52
|
+
for (int i = 0; i < kSymInitializeRetries; ++i) {
|
53
|
+
if (SymInitialize(process, nullptr, true)) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
|
57
|
+
// SymInitialize can fail sometimes with a STATUS_INFO_LENGTH_MISMATCH
|
58
|
+
// NTSTATUS (0xC0000004), which can happen when a module load occurs during
|
59
|
+
// the SymInitialize call. In this case, we should try calling SymInitialize
|
60
|
+
// again.
|
61
|
+
syminitialize_error = GetLastError();
|
62
|
+
// Both NTSTATUS and DWORD are 32-bit numbers, which makes the cast safe.
|
63
|
+
if (syminitialize_error !=
|
64
|
+
static_cast<DWORD>(STATUS_INFO_LENGTH_MISMATCH)) {
|
65
|
+
break;
|
66
|
+
}
|
54
67
|
}
|
68
|
+
|
69
|
+
// GetLastError() returns a Win32 DWORD, but we assign to
|
70
|
+
// unsigned long long to simplify the ABSL_RAW_LOG case below. The uniform
|
71
|
+
// initialization guarantees this is not a narrowing conversion.
|
72
|
+
const unsigned long long error{syminitialize_error};
|
73
|
+
ABSL_RAW_LOG(FATAL, "SymInitialize() failed: %llu", error);
|
55
74
|
}
|
56
75
|
|
57
76
|
bool Symbolize(const void* pc, char* out, int out_size) {
|
@@ -30,7 +30,7 @@
|
|
30
30
|
#include <string>
|
31
31
|
|
32
32
|
#include "absl/base/config.h"
|
33
|
-
#include "absl/base/
|
33
|
+
#include "absl/base/fast_type_id.h"
|
34
34
|
#include "absl/flags/internal/commandlineflag.h"
|
35
35
|
#include "absl/strings/string_view.h"
|
36
36
|
#include "absl/types/optional.h"
|
@@ -80,7 +80,7 @@ class CommandLineFlag {
|
|
80
80
|
// Return true iff flag has type T.
|
81
81
|
template <typename T>
|
82
82
|
inline bool IsOfType() const {
|
83
|
-
return TypeId() ==
|
83
|
+
return TypeId() == FastTypeId<T>();
|
84
84
|
}
|
85
85
|
|
86
86
|
// absl::CommandLineFlag::TryGet()
|
@@ -35,6 +35,7 @@
|
|
35
35
|
|
36
36
|
#include "absl/base/attributes.h"
|
37
37
|
#include "absl/base/config.h"
|
38
|
+
#include "absl/base/nullability.h"
|
38
39
|
#include "absl/base/optimization.h"
|
39
40
|
#include "absl/flags/commandlineflag.h"
|
40
41
|
#include "absl/flags/config.h"
|
@@ -94,7 +95,7 @@ using Flag = flags_internal::Flag<T>;
|
|
94
95
|
// // FLAGS_firstname is a Flag of type `std::string`
|
95
96
|
// std::string first_name = absl::GetFlag(FLAGS_firstname);
|
96
97
|
template <typename T>
|
97
|
-
|
98
|
+
[[nodiscard]] T GetFlag(const absl::Flag<T>& flag) {
|
98
99
|
return flags_internal::FlagImplPeer::InvokeGet<T>(flag);
|
99
100
|
}
|
100
101
|
|
@@ -106,7 +107,7 @@ ABSL_MUST_USE_RESULT T GetFlag(const absl::Flag<T>& flag) {
|
|
106
107
|
// thread-safe, but is potentially expensive. Avoid setting flags in general,
|
107
108
|
// but especially within performance-critical code.
|
108
109
|
template <typename T>
|
109
|
-
void SetFlag(absl::Flag<T>* flag, const T& v) {
|
110
|
+
void SetFlag(absl::Flag<T>* absl_nonnull flag, const T& v) {
|
110
111
|
flags_internal::FlagImplPeer::InvokeSet(*flag, v);
|
111
112
|
}
|
112
113
|
|
@@ -114,7 +115,7 @@ void SetFlag(absl::Flag<T>* flag, const T& v) {
|
|
114
115
|
// convertible to `T`. E.g., use this overload to pass a "const char*" when `T`
|
115
116
|
// is `std::string`.
|
116
117
|
template <typename T, typename V>
|
117
|
-
void SetFlag(absl::Flag<T>* flag, const V& v) {
|
118
|
+
void SetFlag(absl::Flag<T>* absl_nonnull flag, const V& v) {
|
118
119
|
T value(v);
|
119
120
|
flags_internal::FlagImplPeer::InvokeSet(*flag, value);
|
120
121
|
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
#define ABSL_FLAGS_INTERNAL_COMMANDLINEFLAG_H_
|
18
18
|
|
19
19
|
#include "absl/base/config.h"
|
20
|
-
#include "absl/base/
|
20
|
+
#include "absl/base/fast_type_id.h"
|
21
21
|
|
22
22
|
namespace absl {
|
23
23
|
ABSL_NAMESPACE_BEGIN
|
@@ -28,7 +28,7 @@ namespace flags_internal {
|
|
28
28
|
// cases this id is enough to uniquely identify the flag's value type. In a few
|
29
29
|
// cases we'll have to resort to using actual RTTI implementation if it is
|
30
30
|
// available.
|
31
|
-
using FlagFastTypeId = absl::
|
31
|
+
using FlagFastTypeId = absl::FastTypeIdType;
|
32
32
|
|
33
33
|
// Options that control SetCommandLineOptionWithMode.
|
34
34
|
enum FlagSettingMode {
|
@@ -34,6 +34,7 @@
|
|
34
34
|
#include "absl/base/config.h"
|
35
35
|
#include "absl/base/const_init.h"
|
36
36
|
#include "absl/base/dynamic_annotations.h"
|
37
|
+
#include "absl/base/fast_type_id.h"
|
37
38
|
#include "absl/base/no_destructor.h"
|
38
39
|
#include "absl/base/optimization.h"
|
39
40
|
#include "absl/base/thread_annotations.h"
|
@@ -59,7 +60,7 @@ namespace {
|
|
59
60
|
// Currently we only validate flag values for user-defined flag types.
|
60
61
|
bool ShouldValidateFlagValue(FlagFastTypeId flag_type_id) {
|
61
62
|
#define DONT_VALIDATE(T, _) \
|
62
|
-
if (flag_type_id ==
|
63
|
+
if (flag_type_id == absl::FastTypeId<T>()) return false;
|
63
64
|
ABSL_FLAGS_INTERNAL_SUPPORTED_TYPES(DONT_VALIDATE)
|
64
65
|
#undef DONT_VALIDATE
|
65
66
|
|
@@ -57,7 +57,7 @@ template <typename T>
|
|
57
57
|
using Flag = flags_internal::Flag<T>;
|
58
58
|
|
59
59
|
template <typename T>
|
60
|
-
|
60
|
+
[[nodiscard]] T GetFlag(const absl::Flag<T>& flag);
|
61
61
|
|
62
62
|
template <typename T>
|
63
63
|
void SetFlag(absl::Flag<T>* flag, const T& v);
|
@@ -783,7 +783,7 @@ class FlagImpl final : public CommandLineFlag {
|
|
783
783
|
// heap allocation during initialization, which is both slows program startup
|
784
784
|
// and can fail. Using reserved space + placement new allows us to avoid both
|
785
785
|
// problems.
|
786
|
-
alignas(absl::Mutex) mutable char data_guard_[sizeof(absl::Mutex)];
|
786
|
+
alignas(absl::Mutex) mutable unsigned char data_guard_[sizeof(absl::Mutex)];
|
787
787
|
};
|
788
788
|
#if defined(__GNUC__) && !defined(__clang__)
|
789
789
|
#pragma GCC diagnostic pop
|
@@ -828,7 +828,7 @@ class Flag {
|
|
828
828
|
U u;
|
829
829
|
|
830
830
|
#if !defined(NDEBUG)
|
831
|
-
impl_.AssertValidType(
|
831
|
+
impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
|
832
832
|
#endif
|
833
833
|
|
834
834
|
if (ABSL_PREDICT_FALSE(!value_.Get(impl_.seq_lock_, u.value))) {
|
@@ -837,7 +837,7 @@ class Flag {
|
|
837
837
|
return std::move(u.value);
|
838
838
|
}
|
839
839
|
void Set(const T& v) {
|
840
|
-
impl_.AssertValidType(
|
840
|
+
impl_.AssertValidType(absl::FastTypeId<T>(), &GenRuntimeTypeId<T>);
|
841
841
|
impl_.Write(&v);
|
842
842
|
}
|
843
843
|
|
@@ -876,7 +876,8 @@ class FlagImplPeer {
|
|
876
876
|
template <typename T>
|
877
877
|
void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
|
878
878
|
struct AlignedSpace {
|
879
|
-
alignas(MaskedPointer::RequiredAlignment()) alignas(
|
879
|
+
alignas(MaskedPointer::RequiredAlignment()) alignas(
|
880
|
+
T) unsigned char buf[sizeof(T)];
|
880
881
|
};
|
881
882
|
using Allocator = std::allocator<AlignedSpace>;
|
882
883
|
switch (op) {
|
@@ -901,7 +902,7 @@ void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) {
|
|
901
902
|
case FlagOp::kSizeof:
|
902
903
|
return reinterpret_cast<void*>(static_cast<uintptr_t>(sizeof(T)));
|
903
904
|
case FlagOp::kFastTypeId:
|
904
|
-
return const_cast<void*>(
|
905
|
+
return const_cast<void*>(absl::FastTypeId<T>());
|
905
906
|
case FlagOp::kRuntimeTypeId:
|
906
907
|
return const_cast<std::type_info*>(GenRuntimeTypeId<T>());
|
907
908
|
case FlagOp::kParse: {
|