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
@@ -89,8 +89,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
|
|
89
89
|
// acquisition was successful. If the lock was not acquired, false is
|
90
90
|
// returned. If this SpinLock is free at the time of the call, TryLock
|
91
91
|
// will return true with high probability.
|
92
|
-
|
93
|
-
ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
|
92
|
+
[[nodiscard]] inline bool TryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
|
94
93
|
ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock);
|
95
94
|
bool res = TryLockImpl();
|
96
95
|
ABSL_TSAN_MUTEX_POST_LOCK(
|
@@ -121,7 +120,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
|
|
121
120
|
// Determine if the lock is held. When the lock is held by the invoking
|
122
121
|
// thread, true will always be returned. Intended to be used as
|
123
122
|
// CHECK(lock.IsHeld()).
|
124
|
-
|
123
|
+
[[nodiscard]] inline bool IsHeld() const {
|
125
124
|
return (lockword_.load(std::memory_order_relaxed) & kSpinLockHeld) != 0;
|
126
125
|
}
|
127
126
|
|
@@ -203,16 +202,7 @@ class ABSL_LOCKABLE ABSL_ATTRIBUTE_WARN_UNUSED SpinLock {
|
|
203
202
|
|
204
203
|
// Corresponding locker object that arranges to acquire a spinlock for
|
205
204
|
// the duration of a C++ scope.
|
206
|
-
|
207
|
-
// TODO(b/176172494): Use only [[nodiscard]] when baseline is raised.
|
208
|
-
// TODO(b/6695610): Remove forward declaration when #ifdef is no longer needed.
|
209
|
-
#if ABSL_HAVE_CPP_ATTRIBUTE(nodiscard)
|
210
|
-
class [[nodiscard]] SpinLockHolder;
|
211
|
-
#else
|
212
|
-
class ABSL_MUST_USE_RESULT ABSL_ATTRIBUTE_TRIVIAL_ABI SpinLockHolder;
|
213
|
-
#endif
|
214
|
-
|
215
|
-
class ABSL_SCOPED_LOCKABLE SpinLockHolder {
|
205
|
+
class ABSL_SCOPED_LOCKABLE [[nodiscard]] SpinLockHolder {
|
216
206
|
public:
|
217
207
|
inline explicit SpinLockHolder(SpinLock* l) ABSL_EXCLUSIVE_LOCK_FUNCTION(l)
|
218
208
|
: lock_(l) {
|
@@ -36,33 +36,33 @@ namespace absl {
|
|
36
36
|
ABSL_NAMESPACE_BEGIN
|
37
37
|
namespace base_internal {
|
38
38
|
|
39
|
-
inline uint16_t UnalignedLoad16(
|
39
|
+
inline uint16_t UnalignedLoad16(const void* absl_nonnull p) {
|
40
40
|
uint16_t t;
|
41
41
|
memcpy(&t, p, sizeof t);
|
42
42
|
return t;
|
43
43
|
}
|
44
44
|
|
45
|
-
inline uint32_t UnalignedLoad32(
|
45
|
+
inline uint32_t UnalignedLoad32(const void* absl_nonnull p) {
|
46
46
|
uint32_t t;
|
47
47
|
memcpy(&t, p, sizeof t);
|
48
48
|
return t;
|
49
49
|
}
|
50
50
|
|
51
|
-
inline uint64_t UnalignedLoad64(
|
51
|
+
inline uint64_t UnalignedLoad64(const void* absl_nonnull p) {
|
52
52
|
uint64_t t;
|
53
53
|
memcpy(&t, p, sizeof t);
|
54
54
|
return t;
|
55
55
|
}
|
56
56
|
|
57
|
-
inline void UnalignedStore16(
|
57
|
+
inline void UnalignedStore16(void* absl_nonnull p, uint16_t v) {
|
58
58
|
memcpy(p, &v, sizeof v);
|
59
59
|
}
|
60
60
|
|
61
|
-
inline void UnalignedStore32(
|
61
|
+
inline void UnalignedStore32(void* absl_nonnull p, uint32_t v) {
|
62
62
|
memcpy(p, &v, sizeof v);
|
63
63
|
}
|
64
64
|
|
65
|
-
inline void UnalignedStore64(
|
65
|
+
inline void UnalignedStore64(void* absl_nonnull p, uint64_t v) {
|
66
66
|
memcpy(p, &v, sizeof v);
|
67
67
|
}
|
68
68
|
|
@@ -88,9 +88,14 @@ inline int64_t UnscaledCycleClock::Now() {
|
|
88
88
|
#elif defined(__aarch64__)
|
89
89
|
|
90
90
|
// System timer of ARMv8 runs at a different frequency than the CPU's.
|
91
|
-
//
|
92
|
-
//
|
93
|
-
// the
|
91
|
+
//
|
92
|
+
// Frequency is fixed. From Armv8.6-A and Armv9.1-A on, the frequency is 1GHz.
|
93
|
+
// Pre-Armv8.6-A, the frequency was a system design choice, typically in the
|
94
|
+
// range of 1MHz to 50MHz. See also:
|
95
|
+
// https://developer.arm.com/documentation/102379/0101/What-is-the-Generic-Timer-
|
96
|
+
//
|
97
|
+
// It can be read at CNTFRQ special register. We assume the OS has set up the
|
98
|
+
// virtual timer properly.
|
94
99
|
inline int64_t UnscaledCycleClock::Now() {
|
95
100
|
int64_t virtual_timer_value;
|
96
101
|
asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
|
@@ -135,11 +135,11 @@ class NoDestructor {
|
|
135
135
|
// Pretend to be a smart pointer to T with deep constness.
|
136
136
|
// Never returns a null pointer.
|
137
137
|
T& operator*() { return *get(); }
|
138
|
-
|
139
|
-
|
138
|
+
T* absl_nonnull operator->() { return get(); }
|
139
|
+
T* absl_nonnull get() { return impl_.get(); }
|
140
140
|
const T& operator*() const { return *get(); }
|
141
|
-
|
142
|
-
|
141
|
+
const T* absl_nonnull operator->() const { return get(); }
|
142
|
+
const T* absl_nonnull get() const { return impl_.get(); }
|
143
143
|
|
144
144
|
private:
|
145
145
|
class DirectImpl {
|
@@ -147,8 +147,8 @@ class NoDestructor {
|
|
147
147
|
template <typename... Args>
|
148
148
|
explicit constexpr DirectImpl(Args&&... args)
|
149
149
|
: value_(std::forward<Args>(args)...) {}
|
150
|
-
|
151
|
-
|
150
|
+
const T* absl_nonnull get() const { return &value_; }
|
151
|
+
T* absl_nonnull get() { return &value_; }
|
152
152
|
|
153
153
|
private:
|
154
154
|
T value_;
|
@@ -160,33 +160,14 @@ class NoDestructor {
|
|
160
160
|
explicit PlacementImpl(Args&&... args) {
|
161
161
|
new (&space_) T(std::forward<Args>(args)...);
|
162
162
|
}
|
163
|
-
|
164
|
-
return
|
163
|
+
const T* absl_nonnull get() const {
|
164
|
+
return std::launder(reinterpret_cast<const T*>(&space_));
|
165
165
|
}
|
166
|
-
|
167
|
-
|
168
|
-
private:
|
169
|
-
template <typename P>
|
170
|
-
static absl::Nonnull<P*> Launder(absl::Nonnull<P*> p) {
|
171
|
-
#if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606L
|
172
|
-
return std::launder(p);
|
173
|
-
#elif ABSL_HAVE_BUILTIN(__builtin_launder)
|
174
|
-
return __builtin_launder(p);
|
175
|
-
#else
|
176
|
-
// When `std::launder` or equivalent are not available, we rely on
|
177
|
-
// undefined behavior, which works as intended on Abseil's officially
|
178
|
-
// supported platforms as of Q3 2023.
|
179
|
-
#if defined(__GNUC__) && !defined(__clang__)
|
180
|
-
#pragma GCC diagnostic push
|
181
|
-
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
182
|
-
#endif
|
183
|
-
return p;
|
184
|
-
#if defined(__GNUC__) && !defined(__clang__)
|
185
|
-
#pragma GCC diagnostic pop
|
186
|
-
#endif
|
187
|
-
#endif
|
166
|
+
T* absl_nonnull get() {
|
167
|
+
return std::launder(reinterpret_cast<T*>(&space_));
|
188
168
|
}
|
189
169
|
|
170
|
+
private:
|
190
171
|
alignas(T) unsigned char space_[sizeof(T)];
|
191
172
|
};
|
192
173
|
|
@@ -199,12 +180,10 @@ class NoDestructor {
|
|
199
180
|
impl_;
|
200
181
|
};
|
201
182
|
|
202
|
-
#ifdef ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
|
203
183
|
// Provide 'Class Template Argument Deduction': the type of NoDestructor's T
|
204
184
|
// will be the same type as the argument passed to NoDestructor's constructor.
|
205
185
|
template <typename T>
|
206
186
|
NoDestructor(T) -> NoDestructor<T>;
|
207
|
-
#endif // ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION
|
208
187
|
|
209
188
|
ABSL_NAMESPACE_END
|
210
189
|
} // namespace absl
|
@@ -16,21 +16,21 @@
|
|
16
16
|
// File: nullability.h
|
17
17
|
// -----------------------------------------------------------------------------
|
18
18
|
//
|
19
|
-
// This header file defines a set of
|
20
|
-
//
|
21
|
-
//
|
19
|
+
// This header file defines a set of annotations for designating the expected
|
20
|
+
// nullability of pointers. These annotations allow you to designate pointers in
|
21
|
+
// one of three classification states:
|
22
22
|
//
|
23
|
-
// * "Non-null" (for pointers annotated `
|
23
|
+
// * "Non-null" (for pointers annotated `absl_nonnull`), indicating that it is
|
24
24
|
// invalid for the given pointer to ever be null.
|
25
|
-
// * "Nullable" (for pointers annotated `
|
25
|
+
// * "Nullable" (for pointers annotated `absl_nullable`), indicating that it is
|
26
26
|
// valid for the given pointer to be null.
|
27
|
-
// * "Unknown" (for pointers annotated `
|
28
|
-
// that the given pointer has not been
|
27
|
+
// * "Unknown" (for pointers annotated `absl_nullability_unknown`), indicating
|
28
|
+
// that the given pointer has not yet been classified as either nullable or
|
29
29
|
// non-null. This is the default state of unannotated pointers.
|
30
30
|
//
|
31
|
-
// NOTE:
|
32
|
-
// `
|
33
|
-
// in the codebase explicitly.
|
31
|
+
// NOTE: Unannotated pointers implicitly bear the annotation
|
32
|
+
// `absl_nullability_unknown`; you should rarely, if ever, see this annotation
|
33
|
+
// used in the codebase explicitly.
|
34
34
|
//
|
35
35
|
// -----------------------------------------------------------------------------
|
36
36
|
// Nullability and Contracts
|
@@ -64,16 +64,49 @@
|
|
64
64
|
// formalize those contracts within the codebase.
|
65
65
|
//
|
66
66
|
// -----------------------------------------------------------------------------
|
67
|
+
// Annotation Syntax
|
68
|
+
// -----------------------------------------------------------------------------
|
69
|
+
//
|
70
|
+
// The annotations should be positioned as a qualifier for the pointer type. For
|
71
|
+
// example, the position of `const` when declaring a const pointer (not a
|
72
|
+
// pointer to a const type) is the position you should also use for these
|
73
|
+
// annotations.
|
74
|
+
//
|
75
|
+
// Example:
|
76
|
+
//
|
77
|
+
// // A const non-null pointer to an `Employee`.
|
78
|
+
// Employee* absl_nonnull const e;
|
79
|
+
//
|
80
|
+
// // A non-null pointer to a const `Employee`.
|
81
|
+
// const Employee* absl_nonnull e;
|
82
|
+
//
|
83
|
+
// // A non-null pointer to a const nullable pointer to an `Employee`.
|
84
|
+
// Employee* absl_nullable const* absl_nonnull e = nullptr;
|
85
|
+
//
|
86
|
+
// // A non-null function pointer.
|
87
|
+
// void (*absl_nonnull func)(int, double);
|
88
|
+
//
|
89
|
+
// // A non-null array of `Employee`s as a parameter.
|
90
|
+
// void func(Employee employees[absl_nonnull]);
|
91
|
+
//
|
92
|
+
// // A non-null std::unique_ptr to an `Employee`.
|
93
|
+
// // As with `const`, it is possible to place the annotation on either side of
|
94
|
+
// // a named type not ending in `*`, but placing it before the type it
|
95
|
+
// // describes is preferred, unless inconsistent with surrounding code.
|
96
|
+
// absl_nonnull std::unique_ptr<Employee> employee;
|
97
|
+
//
|
98
|
+
// // Invalid annotation usage – this attempts to declare a pointer to a
|
99
|
+
// // nullable `Employee`, which is meaningless.
|
100
|
+
// absl_nullable Employee* e;
|
101
|
+
//
|
102
|
+
// -----------------------------------------------------------------------------
|
67
103
|
// Using Nullability Annotations
|
68
104
|
// -----------------------------------------------------------------------------
|
69
105
|
//
|
70
|
-
//
|
71
|
-
//
|
72
|
-
//
|
73
|
-
//
|
74
|
-
// the contract for the given pointer. Each annotation requires providers or
|
75
|
-
// consumers of these pointers across API boundaries to take appropriate steps
|
76
|
-
// when setting or using these pointers:
|
106
|
+
// Each annotation acts as a form of documentation about the contract for the
|
107
|
+
// given pointer. Each annotation requires providers or consumers of these
|
108
|
+
// pointers across API boundaries to take appropriate steps when setting or
|
109
|
+
// using these pointers:
|
77
110
|
//
|
78
111
|
// * "Non-null" pointers should never be null. It is the responsibility of the
|
79
112
|
// provider of this pointer to ensure that the pointer may never be set to
|
@@ -91,20 +124,20 @@
|
|
91
124
|
// Example:
|
92
125
|
//
|
93
126
|
// // PaySalary() requires the passed pointer to an `Employee` to be non-null.
|
94
|
-
// void PaySalary(
|
127
|
+
// void PaySalary(Employee* absl_nonnull e) {
|
95
128
|
// pay(e->salary); // OK to dereference
|
96
129
|
// }
|
97
130
|
//
|
98
131
|
// // CompleteTransaction() guarantees the returned pointer to an `Account` to
|
99
132
|
// // be non-null.
|
100
|
-
//
|
133
|
+
// Account* absl_nonnull balance CompleteTransaction(double fee) {
|
101
134
|
// ...
|
102
135
|
// }
|
103
136
|
//
|
104
137
|
// // Note that specifying a nullability annotation does not prevent someone
|
105
138
|
// // from violating the contract:
|
106
139
|
//
|
107
|
-
//
|
140
|
+
// Employee* absl_nullable find(Map& employees, std::string_view name);
|
108
141
|
//
|
109
142
|
// void g(Map& employees) {
|
110
143
|
// Employee *e = find(employees, "Pat");
|
@@ -144,14 +177,14 @@
|
|
144
177
|
// These nullability annotations are primarily a human readable signal about the
|
145
178
|
// intended contract of the pointer. They are not *types* and do not currently
|
146
179
|
// provide any correctness guarantees. For example, a pointer annotated as
|
147
|
-
// `
|
148
|
-
// alert or prevent assignment of a `
|
180
|
+
// `absl_nonnull` is *not guaranteed* to be non-null, and the compiler won't
|
181
|
+
// alert or prevent assignment of a `T* absl_nullable` to a `T* absl_nonnull`.
|
149
182
|
// ===========================================================================
|
150
183
|
#ifndef ABSL_BASE_NULLABILITY_H_
|
151
184
|
#define ABSL_BASE_NULLABILITY_H_
|
152
185
|
|
153
186
|
#include "absl/base/config.h"
|
154
|
-
#include "absl/base/internal/
|
187
|
+
#include "absl/base/internal/nullability_deprecated.h"
|
155
188
|
|
156
189
|
// ABSL_POINTERS_DEFAULT_NONNULL
|
157
190
|
//
|
@@ -168,14 +201,14 @@
|
|
168
201
|
// ABSL_POINTERS_DEFAULT_NONNULL
|
169
202
|
//
|
170
203
|
// void FillMessage(Message *m); // implicitly non-null
|
171
|
-
//
|
172
|
-
//
|
204
|
+
// T* absl_nullable GetNullablePtr(); // explicitly nullable
|
205
|
+
// T* absl_nullability_unknown GetUnknownPtr(); // explicitly unknown
|
173
206
|
//
|
174
|
-
// The macro can be safely used in header files
|
207
|
+
// The macro can be safely used in header files – it will not affect any files
|
175
208
|
// that include it.
|
176
209
|
//
|
177
|
-
// In files with the macro, plain `T*` syntax means `
|
178
|
-
// exceptions (`
|
210
|
+
// In files with the macro, plain `T*` syntax means `T* absl_nonnull`, and the
|
211
|
+
// exceptions (`absl_nullable` and `absl_nullability_unknown`) must be marked
|
179
212
|
// explicitly. The same holds, correspondingly, for smart pointer types.
|
180
213
|
//
|
181
214
|
// For comparison, without the macro, all unannotated pointers would default to
|
@@ -183,17 +216,16 @@
|
|
183
216
|
//
|
184
217
|
// #include "absl/base/nullability.h"
|
185
218
|
//
|
186
|
-
// void FillMessage(
|
187
|
-
//
|
219
|
+
// void FillMessage(Message* absl_nonnull m); // explicitly non-null
|
220
|
+
// T* absl_nullable GetNullablePtr(); // explicitly nullable
|
188
221
|
// T* GetUnknownPtr(); // implicitly unknown
|
189
222
|
//
|
190
223
|
// No-op except for being a human readable signal.
|
191
224
|
#define ABSL_POINTERS_DEFAULT_NONNULL
|
192
225
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
// absl::Nonnull (default with `ABSL_POINTERS_DEFAULT_NONNULL`)
|
226
|
+
#if defined(__clang__) && !defined(__OBJC__) && \
|
227
|
+
ABSL_HAVE_FEATURE(nullability_on_classes)
|
228
|
+
// absl_nonnull (default with `ABSL_POINTERS_DEFAULT_NONNULL`)
|
197
229
|
//
|
198
230
|
// The indicated pointer is never null. It is the responsibility of the provider
|
199
231
|
// of this pointer across an API boundary to ensure that the pointer is never
|
@@ -203,13 +235,12 @@ ABSL_NAMESPACE_BEGIN
|
|
203
235
|
// Example:
|
204
236
|
//
|
205
237
|
// // `employee` is designated as not null.
|
206
|
-
// void PaySalary(
|
238
|
+
// void PaySalary(Employee* absl_nonnull employee) {
|
207
239
|
// pay(*employee); // OK to dereference
|
208
240
|
// }
|
209
|
-
|
210
|
-
using Nonnull = nullability_internal::NonnullImpl<T>;
|
241
|
+
#define absl_nonnull _Nonnull
|
211
242
|
|
212
|
-
//
|
243
|
+
// absl_nullable
|
213
244
|
//
|
214
245
|
// The indicated pointer may, by design, be either null or non-null. Consumers
|
215
246
|
// of this pointer across an API boundary should perform a `nullptr` check
|
@@ -218,15 +249,14 @@ using Nonnull = nullability_internal::NonnullImpl<T>;
|
|
218
249
|
// Example:
|
219
250
|
//
|
220
251
|
// // `employee` may be null.
|
221
|
-
// void PaySalary(
|
252
|
+
// void PaySalary(Employee* absl_nullable employee) {
|
222
253
|
// if (employee != nullptr) {
|
223
254
|
// Pay(*employee); // OK to dereference
|
224
255
|
// }
|
225
256
|
// }
|
226
|
-
|
227
|
-
using Nullable = nullability_internal::NullableImpl<T>;
|
257
|
+
#define absl_nullable _Nullable
|
228
258
|
|
229
|
-
//
|
259
|
+
// absl_nullability_unknown (default without `ABSL_POINTERS_DEFAULT_NONNULL`)
|
230
260
|
//
|
231
261
|
// The indicated pointer has not yet been determined to be definitively
|
232
262
|
// "non-null" or "nullable." Providers of such pointers across API boundaries
|
@@ -234,8 +264,8 @@ using Nullable = nullability_internal::NullableImpl<T>;
|
|
234
264
|
// Consumers of these pointers across an API boundary should treat such pointers
|
235
265
|
// with the same caution they treat currently unannotated pointers. Most
|
236
266
|
// existing code will have "unknown" pointers, which should eventually be
|
237
|
-
// migrated into one of the above two nullability states: `
|
238
|
-
// `
|
267
|
+
// migrated into one of the above two nullability states: `absl_nonnull` or
|
268
|
+
// `absl_nullable`.
|
239
269
|
//
|
240
270
|
// NOTE: For files that do not specify `ABSL_POINTERS_DEFAULT_NONNULL`,
|
241
271
|
// because this annotation is the global default state, unannotated pointers are
|
@@ -245,7 +275,7 @@ using Nullable = nullability_internal::NullableImpl<T>;
|
|
245
275
|
// Example:
|
246
276
|
//
|
247
277
|
// // `employee`s nullability state is unknown.
|
248
|
-
// void PaySalary(
|
278
|
+
// void PaySalary(Employee* absl_nullability_unknown employee) {
|
249
279
|
// Pay(*employee); // Potentially dangerous. API provider should investigate.
|
250
280
|
// }
|
251
281
|
//
|
@@ -256,11 +286,15 @@ using Nullable = nullability_internal::NullableImpl<T>;
|
|
256
286
|
// void PaySalary(Employee* employee) {
|
257
287
|
// Pay(*employee); // Potentially dangerous. API provider should investigate.
|
258
288
|
// }
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
289
|
+
#define absl_nullability_unknown _Null_unspecified
|
290
|
+
#else
|
291
|
+
// No-op for non-Clang compilers or Objective-C.
|
292
|
+
#define absl_nonnull
|
293
|
+
// No-op for non-Clang compilers or Objective-C.
|
294
|
+
#define absl_nullable
|
295
|
+
// No-op for non-Clang compilers or Objective-C.
|
296
|
+
#define absl_nullability_unknown
|
297
|
+
#endif
|
264
298
|
|
265
299
|
// ABSL_NULLABILITY_COMPATIBLE
|
266
300
|
//
|
@@ -281,26 +315,4 @@ ABSL_NAMESPACE_END
|
|
281
315
|
#define ABSL_NULLABILITY_COMPATIBLE
|
282
316
|
#endif
|
283
317
|
|
284
|
-
// ABSL_NONNULL
|
285
|
-
// ABSL_NULLABLE
|
286
|
-
// ABSL_NULLABILITY_UNKNOWN
|
287
|
-
//
|
288
|
-
// These macros are analogues of the alias template nullability annotations
|
289
|
-
// above.
|
290
|
-
//
|
291
|
-
// Example:
|
292
|
-
// int* ABSL_NULLABLE foo;
|
293
|
-
// Is equivalent to:
|
294
|
-
// absl::Nullable<int*> foo;
|
295
|
-
#if defined(__clang__) && !defined(__OBJC__) && \
|
296
|
-
ABSL_HAVE_FEATURE(nullability_on_classes)
|
297
|
-
#define ABSL_NONNULL _Nonnull
|
298
|
-
#define ABSL_NULLABLE _Nullable
|
299
|
-
#define ABSL_NULLABILITY_UNKNOWN _Null_unspecified
|
300
|
-
#else
|
301
|
-
#define ABSL_NONNULL
|
302
|
-
#define ABSL_NULLABLE
|
303
|
-
#define ABSL_NULLABILITY_UNKNOWN
|
304
|
-
#endif
|
305
|
-
|
306
318
|
#endif // ABSL_BASE_NULLABILITY_H_
|
@@ -64,65 +64,14 @@
|
|
64
64
|
// proper Abseil implementation at compile-time, which will not be sufficient
|
65
65
|
// to guarantee ABI stability to package managers.
|
66
66
|
|
67
|
+
// SKIP_ABSL_INLINE_NAMESPACE_CHECK
|
68
|
+
|
67
69
|
#ifndef ABSL_BASE_OPTIONS_H_
|
68
70
|
#define ABSL_BASE_OPTIONS_H_
|
69
71
|
|
70
72
|
// -----------------------------------------------------------------------------
|
71
73
|
// Type Compatibility Options
|
72
74
|
// -----------------------------------------------------------------------------
|
73
|
-
//
|
74
|
-
// ABSL_OPTION_USE_STD_ANY
|
75
|
-
//
|
76
|
-
// This option controls whether absl::any is implemented as an alias to
|
77
|
-
// std::any, or as an independent implementation.
|
78
|
-
//
|
79
|
-
// A value of 0 means to use Abseil's implementation. This requires only C++11
|
80
|
-
// support, and is expected to work on every toolchain we support.
|
81
|
-
//
|
82
|
-
// A value of 1 means to use an alias to std::any. This requires that all code
|
83
|
-
// using Abseil is built in C++17 mode or later.
|
84
|
-
//
|
85
|
-
// A value of 2 means to detect the C++ version being used to compile Abseil,
|
86
|
-
// and use an alias only if a working std::any is available. This option is
|
87
|
-
// useful when you are building your entire program, including all of its
|
88
|
-
// dependencies, from source. It should not be used otherwise -- for example,
|
89
|
-
// if you are distributing Abseil in a binary package manager -- since in
|
90
|
-
// mode 2, absl::any will name a different type, with a different mangled name
|
91
|
-
// and binary layout, depending on the compiler flags passed by the end user.
|
92
|
-
// For more info, see https://abseil.io/about/design/dropin-types.
|
93
|
-
//
|
94
|
-
// User code should not inspect this macro. To check in the preprocessor if
|
95
|
-
// absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY.
|
96
|
-
|
97
|
-
#define ABSL_OPTION_USE_STD_ANY 2
|
98
|
-
|
99
|
-
|
100
|
-
// ABSL_OPTION_USE_STD_OPTIONAL
|
101
|
-
//
|
102
|
-
// This option controls whether absl::optional is implemented as an alias to
|
103
|
-
// std::optional, or as an independent implementation.
|
104
|
-
//
|
105
|
-
// A value of 0 means to use Abseil's implementation. This requires only C++11
|
106
|
-
// support, and is expected to work on every toolchain we support.
|
107
|
-
//
|
108
|
-
// A value of 1 means to use an alias to std::optional. This requires that all
|
109
|
-
// code using Abseil is built in C++17 mode or later.
|
110
|
-
//
|
111
|
-
// A value of 2 means to detect the C++ version being used to compile Abseil,
|
112
|
-
// and use an alias only if a working std::optional is available. This option
|
113
|
-
// is useful when you are building your program from source. It should not be
|
114
|
-
// used otherwise -- for example, if you are distributing Abseil in a binary
|
115
|
-
// package manager -- since in mode 2, absl::optional will name a different
|
116
|
-
// type, with a different mangled name and binary layout, depending on the
|
117
|
-
// compiler flags passed by the end user. For more info, see
|
118
|
-
// https://abseil.io/about/design/dropin-types.
|
119
|
-
|
120
|
-
// User code should not inspect this macro. To check in the preprocessor if
|
121
|
-
// absl::optional is a typedef of std::optional, use the feature macro
|
122
|
-
// ABSL_USES_STD_OPTIONAL.
|
123
|
-
|
124
|
-
#define ABSL_OPTION_USE_STD_OPTIONAL 2
|
125
|
-
|
126
75
|
|
127
76
|
// ABSL_OPTION_USE_STD_STRING_VIEW
|
128
77
|
//
|
@@ -150,32 +99,6 @@
|
|
150
99
|
|
151
100
|
#define ABSL_OPTION_USE_STD_STRING_VIEW 2
|
152
101
|
|
153
|
-
// ABSL_OPTION_USE_STD_VARIANT
|
154
|
-
//
|
155
|
-
// This option controls whether absl::variant is implemented as an alias to
|
156
|
-
// std::variant, or as an independent implementation.
|
157
|
-
//
|
158
|
-
// A value of 0 means to use Abseil's implementation. This requires only C++11
|
159
|
-
// support, and is expected to work on every toolchain we support.
|
160
|
-
//
|
161
|
-
// A value of 1 means to use an alias to std::variant. This requires that all
|
162
|
-
// code using Abseil is built in C++17 mode or later.
|
163
|
-
//
|
164
|
-
// A value of 2 means to detect the C++ version being used to compile Abseil,
|
165
|
-
// and use an alias only if a working std::variant is available. This option
|
166
|
-
// is useful when you are building your program from source. It should not be
|
167
|
-
// used otherwise -- for example, if you are distributing Abseil in a binary
|
168
|
-
// package manager -- since in mode 2, absl::variant will name a different
|
169
|
-
// type, with a different mangled name and binary layout, depending on the
|
170
|
-
// compiler flags passed by the end user. For more info, see
|
171
|
-
// https://abseil.io/about/design/dropin-types.
|
172
|
-
//
|
173
|
-
// User code should not inspect this macro. To check in the preprocessor if
|
174
|
-
// absl::variant is a typedef of std::variant, use the feature macro
|
175
|
-
// ABSL_USES_STD_VARIANT.
|
176
|
-
|
177
|
-
#define ABSL_OPTION_USE_STD_VARIANT 2
|
178
|
-
|
179
102
|
// ABSL_OPTION_USE_STD_ORDERING
|
180
103
|
//
|
181
104
|
// This option controls whether absl::{partial,weak,strong}_ordering are
|
@@ -226,7 +149,7 @@
|
|
226
149
|
// allowed.
|
227
150
|
|
228
151
|
#define ABSL_OPTION_USE_INLINE_NAMESPACE 1
|
229
|
-
#define ABSL_OPTION_INLINE_NAMESPACE_NAME
|
152
|
+
#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20250512
|
230
153
|
|
231
154
|
// ABSL_OPTION_HARDENED
|
232
155
|
//
|
@@ -71,15 +71,15 @@
|
|
71
71
|
// C++ Version Check
|
72
72
|
// -----------------------------------------------------------------------------
|
73
73
|
|
74
|
-
// Enforce C++
|
74
|
+
// Enforce C++17 as the minimum.
|
75
75
|
#if defined(_MSVC_LANG)
|
76
|
-
#if _MSVC_LANG <
|
77
|
-
#error "C++ versions less than C++
|
78
|
-
#endif // _MSVC_LANG <
|
76
|
+
#if _MSVC_LANG < 201703L
|
77
|
+
#error "C++ versions less than C++17 are not supported."
|
78
|
+
#endif // _MSVC_LANG < 201703L
|
79
79
|
#elif defined(__cplusplus)
|
80
|
-
#if __cplusplus <
|
81
|
-
#error "C++ versions less than C++
|
82
|
-
#endif // __cplusplus <
|
80
|
+
#if __cplusplus < 201703L
|
81
|
+
#error "C++ versions less than C++17 are not supported."
|
82
|
+
#endif // __cplusplus < 201703L
|
83
83
|
#endif
|
84
84
|
|
85
85
|
// -----------------------------------------------------------------------------
|
@@ -78,7 +78,7 @@ namespace absl {
|
|
78
78
|
ABSL_NAMESPACE_BEGIN
|
79
79
|
|
80
80
|
template <typename Arg, typename Callback = void()>
|
81
|
-
class
|
81
|
+
class [[nodiscard]] Cleanup final {
|
82
82
|
static_assert(cleanup_internal::WasDeduced<Arg>(),
|
83
83
|
"Explicit template parameters are not supported.");
|
84
84
|
|
@@ -115,10 +115,8 @@ class ABSL_MUST_USE_RESULT Cleanup final {
|
|
115
115
|
// `absl::Cleanup c = /* callback */;`
|
116
116
|
//
|
117
117
|
// C++17 type deduction API for creating an instance of `absl::Cleanup`
|
118
|
-
#if defined(ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION)
|
119
118
|
template <typename Callback>
|
120
119
|
Cleanup(Callback callback) -> Cleanup<cleanup_internal::Tag, Callback>;
|
121
|
-
#endif // defined(ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION)
|
122
120
|
|
123
121
|
// `auto c = absl::MakeCleanup(/* callback */);`
|
124
122
|
//
|
@@ -19,7 +19,6 @@
|
|
19
19
|
#include <type_traits>
|
20
20
|
#include <utility>
|
21
21
|
|
22
|
-
#include "absl/base/internal/invoke.h"
|
23
22
|
#include "absl/base/macros.h"
|
24
23
|
#include "absl/base/thread_annotations.h"
|
25
24
|
#include "absl/utility/utility.h"
|
@@ -39,7 +38,7 @@ constexpr bool WasDeduced() {
|
|
39
38
|
|
40
39
|
template <typename Callback>
|
41
40
|
constexpr bool ReturnsVoid() {
|
42
|
-
return (std::is_same<
|
41
|
+
return (std::is_same<std::invoke_result_t<Callback>, void>::value);
|
43
42
|
}
|
44
43
|
|
45
44
|
template <typename Callback>
|
@@ -70,7 +69,7 @@ class Storage {
|
|
70
69
|
|
71
70
|
Storage& operator=(const Storage& other) = delete;
|
72
71
|
|
73
|
-
void* GetCallbackBuffer() { return static_cast<void*>(
|
72
|
+
void* GetCallbackBuffer() { return static_cast<void*>(callback_buffer_); }
|
74
73
|
|
75
74
|
Callback& GetCallback() {
|
76
75
|
return *reinterpret_cast<Callback*>(GetCallbackBuffer());
|
@@ -89,7 +88,7 @@ class Storage {
|
|
89
88
|
|
90
89
|
private:
|
91
90
|
bool is_callback_engaged_;
|
92
|
-
alignas(Callback) char callback_buffer_[sizeof(Callback)];
|
91
|
+
alignas(Callback) unsigned char callback_buffer_[sizeof(Callback)];
|
93
92
|
};
|
94
93
|
|
95
94
|
} // namespace cleanup_internal
|
@@ -47,8 +47,10 @@
|
|
47
47
|
// iterator at the current position. Another important difference is that
|
48
48
|
// key-types must be copy-constructible.
|
49
49
|
//
|
50
|
-
//
|
51
|
-
// is faster than using std::distance
|
50
|
+
// There are other API differences: first, btree iterators can be subtracted,
|
51
|
+
// and this is faster than using `std::distance`. Additionally, btree
|
52
|
+
// iterators can be advanced via `operator+=` and `operator-=`, which is faster
|
53
|
+
// than using `std::advance`.
|
52
54
|
//
|
53
55
|
// B-tree maps are not exception-safe.
|
54
56
|
|