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
@@ -70,6 +70,7 @@
|
|
70
70
|
#include "absl/base/internal/low_level_alloc.h"
|
71
71
|
#include "absl/base/internal/thread_identity.h"
|
72
72
|
#include "absl/base/internal/tsan_mutex_interface.h"
|
73
|
+
#include "absl/base/nullability.h"
|
73
74
|
#include "absl/base/port.h"
|
74
75
|
#include "absl/base/thread_annotations.h"
|
75
76
|
#include "absl/synchronization/internal/kernel_timeout.h"
|
@@ -190,7 +191,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
190
191
|
// If the mutex can be acquired without blocking, does so exclusively and
|
191
192
|
// returns `true`. Otherwise, returns `false`. Returns `true` with high
|
192
193
|
// probability if the `Mutex` was free.
|
193
|
-
|
194
|
+
[[nodiscard]] bool TryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true);
|
194
195
|
|
195
196
|
// Mutex::AssertHeld()
|
196
197
|
//
|
@@ -255,7 +256,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
255
256
|
// If the mutex can be acquired without blocking, acquires this mutex for
|
256
257
|
// shared access and returns `true`. Otherwise, returns `false`. Returns
|
257
258
|
// `true` with high probability if the `Mutex` was free or shared.
|
258
|
-
|
259
|
+
[[nodiscard]] bool ReaderTryLock() ABSL_SHARED_TRYLOCK_FUNCTION(true);
|
259
260
|
|
260
261
|
// Mutex::AssertReaderHeld()
|
261
262
|
//
|
@@ -281,8 +282,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
281
282
|
|
282
283
|
void WriterUnlock() ABSL_UNLOCK_FUNCTION() { this->Unlock(); }
|
283
284
|
|
284
|
-
|
285
|
-
ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
|
285
|
+
[[nodiscard]] bool WriterTryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
|
286
286
|
return this->TryLock();
|
287
287
|
}
|
288
288
|
|
@@ -450,7 +450,9 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
450
450
|
// substantially reduce `Mutex` performance; it should be set only for
|
451
451
|
// non-production runs. Optimization options may also disable invariant
|
452
452
|
// checks.
|
453
|
-
void EnableInvariantDebugging(
|
453
|
+
void EnableInvariantDebugging(
|
454
|
+
void (*absl_nullable invariant)(void* absl_nullability_unknown),
|
455
|
+
void* absl_nullability_unknown arg);
|
454
456
|
|
455
457
|
// Mutex::EnableDebugLog()
|
456
458
|
//
|
@@ -459,7 +461,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
459
461
|
// call to `EnableInvariantDebugging()` or `EnableDebugLog()` has been made.
|
460
462
|
//
|
461
463
|
// Note: This method substantially reduces `Mutex` performance.
|
462
|
-
void EnableDebugLog(const char* name);
|
464
|
+
void EnableDebugLog(const char* absl_nullable name);
|
463
465
|
|
464
466
|
// Deadlock detection
|
465
467
|
|
@@ -509,20 +511,23 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
509
511
|
|
510
512
|
// Post()/Wait() versus associated PerThreadSem; in class for required
|
511
513
|
// friendship with PerThreadSem.
|
512
|
-
static void IncrementSynchSem(Mutex* mu,
|
513
|
-
|
514
|
+
static void IncrementSynchSem(Mutex* absl_nonnull mu,
|
515
|
+
base_internal::PerThreadSynch* absl_nonnull w);
|
516
|
+
static bool DecrementSynchSem(Mutex* absl_nonnull mu,
|
517
|
+
base_internal::PerThreadSynch* absl_nonnull w,
|
514
518
|
synchronization_internal::KernelTimeout t);
|
515
519
|
|
516
520
|
// slow path acquire
|
517
|
-
void LockSlowLoop(SynchWaitParams* waitp, int flags);
|
521
|
+
void LockSlowLoop(SynchWaitParams* absl_nonnull waitp, int flags);
|
518
522
|
// wrappers around LockSlowLoop()
|
519
|
-
bool LockSlowWithDeadline(MuHow how,
|
523
|
+
bool LockSlowWithDeadline(MuHow absl_nonnull how,
|
524
|
+
const Condition* absl_nullable cond,
|
520
525
|
synchronization_internal::KernelTimeout t,
|
521
526
|
int flags);
|
522
|
-
void LockSlow(MuHow how, const Condition* cond,
|
527
|
+
void LockSlow(MuHow absl_nonnull how, const Condition* absl_nullable cond,
|
523
528
|
int flags) ABSL_ATTRIBUTE_COLD;
|
524
529
|
// slow path release
|
525
|
-
void UnlockSlow(SynchWaitParams* waitp) ABSL_ATTRIBUTE_COLD;
|
530
|
+
void UnlockSlow(SynchWaitParams* absl_nullable waitp) ABSL_ATTRIBUTE_COLD;
|
526
531
|
// TryLock slow path.
|
527
532
|
bool TryLockSlow();
|
528
533
|
// ReaderTryLock slow path.
|
@@ -533,20 +538,21 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
|
|
533
538
|
bool LockWhenCommon(const Condition& cond,
|
534
539
|
synchronization_internal::KernelTimeout t, bool write);
|
535
540
|
// Attempt to remove thread s from queue.
|
536
|
-
void TryRemove(base_internal::PerThreadSynch* s);
|
541
|
+
void TryRemove(base_internal::PerThreadSynch* absl_nonnull s);
|
537
542
|
// Block a thread on mutex.
|
538
|
-
void Block(base_internal::PerThreadSynch* s);
|
543
|
+
void Block(base_internal::PerThreadSynch* absl_nonnull s);
|
539
544
|
// Wake a thread; return successor.
|
540
|
-
base_internal::PerThreadSynch* Wakeup(
|
545
|
+
base_internal::PerThreadSynch* absl_nullable Wakeup(
|
546
|
+
base_internal::PerThreadSynch* absl_nonnull w);
|
541
547
|
void Dtor();
|
542
548
|
|
543
549
|
friend class CondVar; // for access to Trans()/Fer().
|
544
|
-
void Trans(MuHow how); // used for CondVar->Mutex transfer
|
545
|
-
void Fer(
|
546
|
-
|
550
|
+
void Trans(MuHow absl_nonnull how); // used for CondVar->Mutex transfer
|
551
|
+
void Fer(base_internal::PerThreadSynch* absl_nonnull
|
552
|
+
w); // used for CondVar->Mutex transfer
|
547
553
|
|
548
554
|
// Catch the error of writing Mutex when intending MutexLock.
|
549
|
-
explicit Mutex(const volatile Mutex* /*ignored*/) {}
|
555
|
+
explicit Mutex(const volatile Mutex* absl_nullable /*ignored*/) {}
|
550
556
|
|
551
557
|
Mutex(const Mutex&) = delete;
|
552
558
|
Mutex& operator=(const Mutex&) = delete;
|
@@ -581,14 +587,15 @@ class ABSL_SCOPED_LOCKABLE MutexLock {
|
|
581
587
|
// Calls `mu->Lock()` and returns when that call returns. That is, `*mu` is
|
582
588
|
// guaranteed to be locked when this object is constructed. Requires that
|
583
589
|
// `mu` be dereferenceable.
|
584
|
-
explicit MutexLock(Mutex* mu) ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
590
|
+
explicit MutexLock(Mutex* absl_nonnull mu) ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
591
|
+
: mu_(mu) {
|
585
592
|
this->mu_->Lock();
|
586
593
|
}
|
587
594
|
|
588
595
|
// Like above, but calls `mu->LockWhen(cond)` instead. That is, in addition to
|
589
596
|
// the above, the condition given by `cond` is also guaranteed to hold when
|
590
597
|
// this object is constructed.
|
591
|
-
explicit MutexLock(Mutex* mu, const Condition& cond)
|
598
|
+
explicit MutexLock(Mutex* absl_nonnull mu, const Condition& cond)
|
592
599
|
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
593
600
|
: mu_(mu) {
|
594
601
|
this->mu_->LockWhen(cond);
|
@@ -602,7 +609,7 @@ class ABSL_SCOPED_LOCKABLE MutexLock {
|
|
602
609
|
~MutexLock() ABSL_UNLOCK_FUNCTION() { this->mu_->Unlock(); }
|
603
610
|
|
604
611
|
private:
|
605
|
-
Mutex* const mu_;
|
612
|
+
Mutex* absl_nonnull const mu_;
|
606
613
|
};
|
607
614
|
|
608
615
|
// ReaderMutexLock
|
@@ -611,11 +618,12 @@ class ABSL_SCOPED_LOCKABLE MutexLock {
|
|
611
618
|
// releases a shared lock on a `Mutex` via RAII.
|
612
619
|
class ABSL_SCOPED_LOCKABLE ReaderMutexLock {
|
613
620
|
public:
|
614
|
-
explicit ReaderMutexLock(Mutex* mu) ABSL_SHARED_LOCK_FUNCTION(mu)
|
621
|
+
explicit ReaderMutexLock(Mutex* absl_nonnull mu) ABSL_SHARED_LOCK_FUNCTION(mu)
|
622
|
+
: mu_(mu) {
|
615
623
|
mu->ReaderLock();
|
616
624
|
}
|
617
625
|
|
618
|
-
explicit ReaderMutexLock(Mutex* mu, const Condition& cond)
|
626
|
+
explicit ReaderMutexLock(Mutex* absl_nonnull mu, const Condition& cond)
|
619
627
|
ABSL_SHARED_LOCK_FUNCTION(mu)
|
620
628
|
: mu_(mu) {
|
621
629
|
mu->ReaderLockWhen(cond);
|
@@ -629,7 +637,7 @@ class ABSL_SCOPED_LOCKABLE ReaderMutexLock {
|
|
629
637
|
~ReaderMutexLock() ABSL_UNLOCK_FUNCTION() { this->mu_->ReaderUnlock(); }
|
630
638
|
|
631
639
|
private:
|
632
|
-
Mutex* const mu_;
|
640
|
+
Mutex* absl_nonnull const mu_;
|
633
641
|
};
|
634
642
|
|
635
643
|
// WriterMutexLock
|
@@ -638,12 +646,13 @@ class ABSL_SCOPED_LOCKABLE ReaderMutexLock {
|
|
638
646
|
// releases a write (exclusive) lock on a `Mutex` via RAII.
|
639
647
|
class ABSL_SCOPED_LOCKABLE WriterMutexLock {
|
640
648
|
public:
|
641
|
-
explicit WriterMutexLock(Mutex*
|
649
|
+
explicit WriterMutexLock(Mutex* absl_nonnull mu)
|
650
|
+
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
642
651
|
: mu_(mu) {
|
643
652
|
mu->WriterLock();
|
644
653
|
}
|
645
654
|
|
646
|
-
explicit WriterMutexLock(Mutex* mu, const Condition& cond)
|
655
|
+
explicit WriterMutexLock(Mutex* absl_nonnull mu, const Condition& cond)
|
647
656
|
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
648
657
|
: mu_(mu) {
|
649
658
|
mu->WriterLockWhen(cond);
|
@@ -657,7 +666,7 @@ class ABSL_SCOPED_LOCKABLE WriterMutexLock {
|
|
657
666
|
~WriterMutexLock() ABSL_UNLOCK_FUNCTION() { this->mu_->WriterUnlock(); }
|
658
667
|
|
659
668
|
private:
|
660
|
-
Mutex* const mu_;
|
669
|
+
Mutex* absl_nonnull const mu_;
|
661
670
|
};
|
662
671
|
|
663
672
|
// -----------------------------------------------------------------------------
|
@@ -715,7 +724,8 @@ class ABSL_SCOPED_LOCKABLE WriterMutexLock {
|
|
715
724
|
class Condition {
|
716
725
|
public:
|
717
726
|
// A Condition that returns the result of "(*func)(arg)"
|
718
|
-
Condition(bool (*func)(void*),
|
727
|
+
Condition(bool (*absl_nonnull func)(void* absl_nullability_unknown),
|
728
|
+
void* absl_nullability_unknown arg);
|
719
729
|
|
720
730
|
// Templated version for people who are averse to casts.
|
721
731
|
//
|
@@ -727,7 +737,8 @@ class Condition {
|
|
727
737
|
//
|
728
738
|
// See class comment for performance advice.
|
729
739
|
template <typename T>
|
730
|
-
Condition(bool (*func)(T*),
|
740
|
+
Condition(bool (*absl_nonnull func)(T* absl_nullability_unknown),
|
741
|
+
T* absl_nullability_unknown arg);
|
731
742
|
|
732
743
|
// Same as above, but allows for cases where `arg` comes from a pointer that
|
733
744
|
// is convertible to the function parameter type `T*` but not an exact match.
|
@@ -741,8 +752,10 @@ class Condition {
|
|
741
752
|
// a function template is passed as `func`. Also, the dummy `typename = void`
|
742
753
|
// template parameter exists just to work around a MSVC mangling bug.
|
743
754
|
template <typename T, typename = void>
|
744
|
-
Condition(
|
745
|
-
|
755
|
+
Condition(
|
756
|
+
bool (*absl_nonnull func)(T* absl_nullability_unknown),
|
757
|
+
typename absl::internal::type_identity<T>::type* absl_nullability_unknown
|
758
|
+
arg);
|
746
759
|
|
747
760
|
// Templated version for invoking a method that returns a `bool`.
|
748
761
|
//
|
@@ -753,16 +766,19 @@ class Condition {
|
|
753
766
|
// methods to come from base classes. A simpler signature like
|
754
767
|
// `Condition(T*, bool (T::*)())` does not suffice.
|
755
768
|
template <typename T>
|
756
|
-
Condition(
|
757
|
-
|
769
|
+
Condition(
|
770
|
+
T* absl_nonnull object,
|
771
|
+
bool (absl::internal::type_identity<T>::type::* absl_nonnull method)());
|
758
772
|
|
759
773
|
// Same as above, for const members
|
760
774
|
template <typename T>
|
761
|
-
Condition(
|
762
|
-
|
775
|
+
Condition(
|
776
|
+
const T* absl_nonnull object,
|
777
|
+
bool (absl::internal::type_identity<T>::type::* absl_nonnull method)()
|
778
|
+
const);
|
763
779
|
|
764
780
|
// A Condition that returns the value of `*cond`
|
765
|
-
explicit Condition(const bool* cond);
|
781
|
+
explicit Condition(const bool* absl_nonnull cond);
|
766
782
|
|
767
783
|
// Templated version for invoking a functor that returns a `bool`.
|
768
784
|
// This approach accepts pointers to non-mutable lambdas, `std::function`,
|
@@ -791,7 +807,7 @@ class Condition {
|
|
791
807
|
// `bool operator() const`.
|
792
808
|
template <typename T, typename E = decltype(static_cast<bool (T::*)() const>(
|
793
809
|
&T::operator()))>
|
794
|
-
explicit Condition(const T* obj)
|
810
|
+
explicit Condition(const T* absl_nonnull obj)
|
795
811
|
: Condition(obj, static_cast<bool (T::*)() const>(&T::operator())) {}
|
796
812
|
|
797
813
|
// A Condition that always returns `true`.
|
@@ -817,7 +833,8 @@ class Condition {
|
|
817
833
|
// Two `Condition` values are guaranteed equal if both their `func` and `arg`
|
818
834
|
// components are the same. A null pointer is equivalent to a `true`
|
819
835
|
// condition.
|
820
|
-
static bool GuaranteedEqual(const Condition* a,
|
836
|
+
static bool GuaranteedEqual(const Condition* absl_nullable a,
|
837
|
+
const Condition* absl_nullable b);
|
821
838
|
|
822
839
|
private:
|
823
840
|
// Sizing an allocation for a method pointer can be subtle. In the Itanium
|
@@ -842,17 +859,17 @@ class Condition {
|
|
842
859
|
#endif
|
843
860
|
|
844
861
|
// Function with which to evaluate callbacks and/or arguments.
|
845
|
-
bool (*eval_)(const Condition*) = nullptr;
|
862
|
+
bool (*absl_nullable eval_)(const Condition* absl_nonnull) = nullptr;
|
846
863
|
|
847
864
|
// Either an argument for a function call or an object for a method call.
|
848
|
-
void* arg_ = nullptr;
|
865
|
+
void* absl_nullable arg_ = nullptr;
|
849
866
|
|
850
867
|
// Various functions eval_ can point to:
|
851
|
-
static bool CallVoidPtrFunction(const Condition*);
|
868
|
+
static bool CallVoidPtrFunction(const Condition* absl_nonnull c);
|
852
869
|
template <typename T>
|
853
|
-
static bool CastAndCallFunction(const Condition* c);
|
870
|
+
static bool CastAndCallFunction(const Condition* absl_nonnull c);
|
854
871
|
template <typename T, typename ConditionMethodPtr>
|
855
|
-
static bool CastAndCallMethod(const Condition* c);
|
872
|
+
static bool CastAndCallMethod(const Condition* absl_nonnull c);
|
856
873
|
|
857
874
|
// Helper methods for storing, validating, and reading callback arguments.
|
858
875
|
template <typename T>
|
@@ -864,11 +881,11 @@ class Condition {
|
|
864
881
|
}
|
865
882
|
|
866
883
|
template <typename T>
|
867
|
-
inline void ReadCallback(T* callback) const {
|
884
|
+
inline void ReadCallback(T* absl_nonnull callback) const {
|
868
885
|
std::memcpy(callback, callback_, sizeof(*callback));
|
869
886
|
}
|
870
887
|
|
871
|
-
static bool AlwaysTrue(const Condition*) { return true; }
|
888
|
+
static bool AlwaysTrue(const Condition* absl_nullable) { return true; }
|
872
889
|
|
873
890
|
// Used only to create kTrue.
|
874
891
|
constexpr Condition() : eval_(AlwaysTrue), arg_(nullptr) {}
|
@@ -922,7 +939,7 @@ class CondVar {
|
|
922
939
|
// spurious wakeup), then reacquires the `Mutex` and returns.
|
923
940
|
//
|
924
941
|
// Requires and ensures that the current thread holds the `Mutex`.
|
925
|
-
void Wait(Mutex* mu) {
|
942
|
+
void Wait(Mutex* absl_nonnull mu) {
|
926
943
|
WaitCommon(mu, synchronization_internal::KernelTimeout::Never());
|
927
944
|
}
|
928
945
|
|
@@ -939,7 +956,7 @@ class CondVar {
|
|
939
956
|
// to return `true` or `false`.
|
940
957
|
//
|
941
958
|
// Requires and ensures that the current thread holds the `Mutex`.
|
942
|
-
bool WaitWithTimeout(Mutex* mu, absl::Duration timeout) {
|
959
|
+
bool WaitWithTimeout(Mutex* absl_nonnull mu, absl::Duration timeout) {
|
943
960
|
return WaitCommon(mu, synchronization_internal::KernelTimeout(timeout));
|
944
961
|
}
|
945
962
|
|
@@ -958,7 +975,7 @@ class CondVar {
|
|
958
975
|
// to return `true` or `false`.
|
959
976
|
//
|
960
977
|
// Requires and ensures that the current thread holds the `Mutex`.
|
961
|
-
bool WaitWithDeadline(Mutex* mu, absl::Time deadline) {
|
978
|
+
bool WaitWithDeadline(Mutex* absl_nonnull mu, absl::Time deadline) {
|
962
979
|
return WaitCommon(mu, synchronization_internal::KernelTimeout(deadline));
|
963
980
|
}
|
964
981
|
|
@@ -977,11 +994,12 @@ class CondVar {
|
|
977
994
|
// Causes all subsequent uses of this `CondVar` to be logged via
|
978
995
|
// `ABSL_RAW_LOG(INFO)`. Log entries are tagged with `name` if `name != 0`.
|
979
996
|
// Note: this method substantially reduces `CondVar` performance.
|
980
|
-
void EnableDebugLog(const char* name);
|
997
|
+
void EnableDebugLog(const char* absl_nullable name);
|
981
998
|
|
982
999
|
private:
|
983
|
-
bool WaitCommon(Mutex* mutex,
|
984
|
-
|
1000
|
+
bool WaitCommon(Mutex* absl_nonnull mutex,
|
1001
|
+
synchronization_internal::KernelTimeout t);
|
1002
|
+
void Remove(base_internal::PerThreadSynch* absl_nonnull s);
|
985
1003
|
std::atomic<intptr_t> cv_; // Condition variable state.
|
986
1004
|
CondVar(const CondVar&) = delete;
|
987
1005
|
CondVar& operator=(const CondVar&) = delete;
|
@@ -997,14 +1015,15 @@ class CondVar {
|
|
997
1015
|
// MutexLockMaybe is like MutexLock, but is a no-op when mu is null.
|
998
1016
|
class ABSL_SCOPED_LOCKABLE MutexLockMaybe {
|
999
1017
|
public:
|
1000
|
-
explicit MutexLockMaybe(Mutex*
|
1018
|
+
explicit MutexLockMaybe(Mutex* absl_nullable mu)
|
1019
|
+
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
1001
1020
|
: mu_(mu) {
|
1002
1021
|
if (this->mu_ != nullptr) {
|
1003
1022
|
this->mu_->Lock();
|
1004
1023
|
}
|
1005
1024
|
}
|
1006
1025
|
|
1007
|
-
explicit MutexLockMaybe(Mutex* mu, const Condition& cond)
|
1026
|
+
explicit MutexLockMaybe(Mutex* absl_nullable mu, const Condition& cond)
|
1008
1027
|
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
1009
1028
|
: mu_(mu) {
|
1010
1029
|
if (this->mu_ != nullptr) {
|
@@ -1019,7 +1038,7 @@ class ABSL_SCOPED_LOCKABLE MutexLockMaybe {
|
|
1019
1038
|
}
|
1020
1039
|
|
1021
1040
|
private:
|
1022
|
-
Mutex* const mu_;
|
1041
|
+
Mutex* absl_nullable const mu_;
|
1023
1042
|
MutexLockMaybe(const MutexLockMaybe&) = delete;
|
1024
1043
|
MutexLockMaybe(MutexLockMaybe&&) = delete;
|
1025
1044
|
MutexLockMaybe& operator=(const MutexLockMaybe&) = delete;
|
@@ -1032,12 +1051,13 @@ class ABSL_SCOPED_LOCKABLE MutexLockMaybe {
|
|
1032
1051
|
// mutex before destruction. `Release()` may be called at most once.
|
1033
1052
|
class ABSL_SCOPED_LOCKABLE ReleasableMutexLock {
|
1034
1053
|
public:
|
1035
|
-
explicit ReleasableMutexLock(Mutex*
|
1054
|
+
explicit ReleasableMutexLock(Mutex* absl_nonnull mu)
|
1055
|
+
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
1036
1056
|
: mu_(mu) {
|
1037
1057
|
this->mu_->Lock();
|
1038
1058
|
}
|
1039
1059
|
|
1040
|
-
explicit ReleasableMutexLock(Mutex* mu, const Condition& cond)
|
1060
|
+
explicit ReleasableMutexLock(Mutex* absl_nonnull mu, const Condition& cond)
|
1041
1061
|
ABSL_EXCLUSIVE_LOCK_FUNCTION(mu)
|
1042
1062
|
: mu_(mu) {
|
1043
1063
|
this->mu_->LockWhen(cond);
|
@@ -1052,7 +1072,7 @@ class ABSL_SCOPED_LOCKABLE ReleasableMutexLock {
|
|
1052
1072
|
void Release() ABSL_UNLOCK_FUNCTION();
|
1053
1073
|
|
1054
1074
|
private:
|
1055
|
-
Mutex* mu_;
|
1075
|
+
Mutex* absl_nonnull mu_;
|
1056
1076
|
ReleasableMutexLock(const ReleasableMutexLock&) = delete;
|
1057
1077
|
ReleasableMutexLock(ReleasableMutexLock&&) = delete;
|
1058
1078
|
ReleasableMutexLock& operator=(const ReleasableMutexLock&) = delete;
|
@@ -1084,7 +1104,7 @@ inline CondVar::CondVar() : cv_(0) {}
|
|
1084
1104
|
|
1085
1105
|
// static
|
1086
1106
|
template <typename T, typename ConditionMethodPtr>
|
1087
|
-
bool Condition::CastAndCallMethod(const Condition* c) {
|
1107
|
+
bool Condition::CastAndCallMethod(const Condition* absl_nonnull c) {
|
1088
1108
|
T* object = static_cast<T*>(c->arg_);
|
1089
1109
|
ConditionMethodPtr condition_method_pointer;
|
1090
1110
|
c->ReadCallback(&condition_method_pointer);
|
@@ -1093,7 +1113,7 @@ bool Condition::CastAndCallMethod(const Condition* c) {
|
|
1093
1113
|
|
1094
1114
|
// static
|
1095
1115
|
template <typename T>
|
1096
|
-
bool Condition::CastAndCallFunction(const Condition* c) {
|
1116
|
+
bool Condition::CastAndCallFunction(const Condition* absl_nonnull c) {
|
1097
1117
|
bool (*function)(T*);
|
1098
1118
|
c->ReadCallback(&function);
|
1099
1119
|
T* argument = static_cast<T*>(c->arg_);
|
@@ -1101,7 +1121,9 @@ bool Condition::CastAndCallFunction(const Condition* c) {
|
|
1101
1121
|
}
|
1102
1122
|
|
1103
1123
|
template <typename T>
|
1104
|
-
inline Condition::Condition(
|
1124
|
+
inline Condition::Condition(
|
1125
|
+
bool (*absl_nonnull func)(T* absl_nullability_unknown),
|
1126
|
+
T* absl_nullability_unknown arg)
|
1105
1127
|
: eval_(&CastAndCallFunction<T>),
|
1106
1128
|
arg_(const_cast<void*>(static_cast<const void*>(arg))) {
|
1107
1129
|
static_assert(sizeof(&func) <= sizeof(callback_),
|
@@ -1111,13 +1133,16 @@ inline Condition::Condition(bool (*func)(T*), T* arg)
|
|
1111
1133
|
|
1112
1134
|
template <typename T, typename>
|
1113
1135
|
inline Condition::Condition(
|
1114
|
-
bool (*func)(T*),
|
1136
|
+
bool (*absl_nonnull func)(T* absl_nullability_unknown),
|
1137
|
+
typename absl::internal::type_identity<T>::type* absl_nullability_unknown
|
1138
|
+
arg)
|
1115
1139
|
// Just delegate to the overload above.
|
1116
1140
|
: Condition(func, arg) {}
|
1117
1141
|
|
1118
1142
|
template <typename T>
|
1119
1143
|
inline Condition::Condition(
|
1120
|
-
T* object,
|
1144
|
+
T* absl_nonnull object,
|
1145
|
+
bool (absl::internal::type_identity<T>::type::* absl_nonnull method)())
|
1121
1146
|
: eval_(&CastAndCallMethod<T, decltype(method)>), arg_(object) {
|
1122
1147
|
static_assert(sizeof(&method) <= sizeof(callback_),
|
1123
1148
|
"An overlarge method pointer was passed to Condition.");
|
@@ -1126,8 +1151,9 @@ inline Condition::Condition(
|
|
1126
1151
|
|
1127
1152
|
template <typename T>
|
1128
1153
|
inline Condition::Condition(
|
1129
|
-
const T* object,
|
1130
|
-
bool (absl::internal::type_identity<T>::type::*method)()
|
1154
|
+
const T* absl_nonnull object,
|
1155
|
+
bool (absl::internal::type_identity<T>::type::* absl_nonnull method)()
|
1156
|
+
const)
|
1131
1157
|
: eval_(&CastAndCallMethod<const T, decltype(method)>),
|
1132
1158
|
arg_(reinterpret_cast<void*>(const_cast<T*>(object))) {
|
1133
1159
|
StoreCallback(method);
|
@@ -1145,7 +1171,7 @@ inline Condition::Condition(
|
|
1145
1171
|
// binary; if this function is called a second time with a different function
|
1146
1172
|
// pointer, the value is ignored (and will cause an assertion failure in debug
|
1147
1173
|
// mode.)
|
1148
|
-
void RegisterMutexProfiler(void (*fn)(int64_t wait_cycles));
|
1174
|
+
void RegisterMutexProfiler(void (*absl_nonnull fn)(int64_t wait_cycles));
|
1149
1175
|
|
1150
1176
|
// Register a hook for Mutex tracing.
|
1151
1177
|
//
|
@@ -1159,8 +1185,9 @@ void RegisterMutexProfiler(void (*fn)(int64_t wait_cycles));
|
|
1159
1185
|
//
|
1160
1186
|
// This has the same ordering and single-use limitations as
|
1161
1187
|
// RegisterMutexProfiler() above.
|
1162
|
-
void RegisterMutexTracer(void (*fn)(const char* msg,
|
1163
|
-
|
1188
|
+
void RegisterMutexTracer(void (*absl_nonnull fn)(const char* absl_nonnull msg,
|
1189
|
+
const void* absl_nonnull obj,
|
1190
|
+
int64_t wait_cycles));
|
1164
1191
|
|
1165
1192
|
// Register a hook for CondVar tracing.
|
1166
1193
|
//
|
@@ -1174,7 +1201,8 @@ void RegisterMutexTracer(void (*fn)(const char* msg, const void* obj,
|
|
1174
1201
|
//
|
1175
1202
|
// This has the same ordering and single-use limitations as
|
1176
1203
|
// RegisterMutexProfiler() above.
|
1177
|
-
void RegisterCondVarTracer(void (*fn)(
|
1204
|
+
void RegisterCondVarTracer(void (*absl_nonnull fn)(
|
1205
|
+
const char* absl_nonnull msg, const void* absl_nonnull cv));
|
1178
1206
|
|
1179
1207
|
// EnableMutexInvariantDebugging()
|
1180
1208
|
//
|
@@ -75,7 +75,7 @@ class Notification {
|
|
75
75
|
// Notification::HasBeenNotified()
|
76
76
|
//
|
77
77
|
// Returns the value of the notification's internal "notified" state.
|
78
|
-
|
78
|
+
[[nodiscard]] bool HasBeenNotified() const {
|
79
79
|
if (HasBeenNotifiedInternal(&this->notified_yet_)) {
|
80
80
|
base_internal::TraceObserved(this, TraceObjectKind());
|
81
81
|
return true;
|
@@ -202,7 +202,8 @@ inline bool SafeAddRepHi(double a_hi, double b_hi, Duration* d) {
|
|
202
202
|
*d = -InfiniteDuration();
|
203
203
|
return false;
|
204
204
|
}
|
205
|
-
*d = time_internal::MakeDuration(c,
|
205
|
+
*d = time_internal::MakeDuration(static_cast<int64_t>(c),
|
206
|
+
time_internal::GetRepLo(*d));
|
206
207
|
return true;
|
207
208
|
}
|
208
209
|
|
@@ -239,8 +240,8 @@ inline Duration ScaleFixed(Duration d, int64_t r) {
|
|
239
240
|
template <template <typename> class Operation>
|
240
241
|
inline Duration ScaleDouble(Duration d, double r) {
|
241
242
|
Operation<double> op;
|
242
|
-
double hi_doub = op(time_internal::GetRepHi(d), r);
|
243
|
-
double lo_doub = op(time_internal::GetRepLo(d), r);
|
243
|
+
double hi_doub = op(static_cast<double>(time_internal::GetRepHi(d)), r);
|
244
|
+
double lo_doub = op(static_cast<double>(time_internal::GetRepLo(d)), r);
|
244
245
|
|
245
246
|
double hi_int = 0;
|
246
247
|
double hi_frac = std::modf(hi_doub, &hi_int);
|
@@ -253,12 +254,15 @@ inline Duration ScaleDouble(Duration d, double r) {
|
|
253
254
|
double lo_frac = std::modf(lo_doub, &lo_int);
|
254
255
|
|
255
256
|
// Rolls lo into hi if necessary.
|
256
|
-
int64_t lo64 = std::round(lo_frac * kTicksPerSecond);
|
257
|
+
int64_t lo64 = static_cast<int64_t>(std::round(lo_frac * kTicksPerSecond));
|
257
258
|
|
258
259
|
Duration ans;
|
259
260
|
if (!SafeAddRepHi(hi_int, lo_int, &ans)) return ans;
|
260
261
|
int64_t hi64 = time_internal::GetRepHi(ans);
|
261
|
-
if (!SafeAddRepHi(hi64,
|
262
|
+
if (!SafeAddRepHi(static_cast<double>(hi64),
|
263
|
+
static_cast<double>(lo64 / kTicksPerSecond), &ans)) {
|
264
|
+
return ans;
|
265
|
+
}
|
262
266
|
hi64 = time_internal::GetRepHi(ans);
|
263
267
|
lo64 %= kTicksPerSecond;
|
264
268
|
NormalizeTicks(&hi64, &lo64);
|
@@ -699,8 +703,9 @@ void AppendNumberUnit(std::string* out, double n, DisplayUnit unit) {
|
|
699
703
|
char buf[kBufferSize]; // also large enough to hold integer part
|
700
704
|
char* ep = buf + sizeof(buf);
|
701
705
|
double d = 0;
|
702
|
-
int64_t frac_part =
|
703
|
-
|
706
|
+
int64_t frac_part =
|
707
|
+
static_cast<int64_t>(std::round(std::modf(n, &d) * unit.pow10));
|
708
|
+
int64_t int_part = static_cast<int64_t>(d);
|
704
709
|
if (int_part != 0 || frac_part != 0) {
|
705
710
|
char* bp = Format64(ep, 0, int_part); // always < 1000
|
706
711
|
out->append(bp, static_cast<size_t>(ep - bp));
|
@@ -200,7 +200,7 @@ class time_zone {
|
|
200
200
|
// version() and description() provide additional information about the
|
201
201
|
// time zone. The content of each of the returned strings is unspecified,
|
202
202
|
// however, when the IANA Time Zone Database is the underlying data source
|
203
|
-
// the version() string will be in the
|
203
|
+
// the version() string will be in the familiar form (e.g, "2018e") or
|
204
204
|
// empty when unavailable.
|
205
205
|
//
|
206
206
|
// Note: These functions are for informational or testing purposes only.
|