grpc 1.57.0 → 1.58.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (402) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +534 -284
  3. data/include/grpc/event_engine/event_engine.h +0 -1
  4. data/include/grpc/event_engine/memory_allocator.h +2 -2
  5. data/include/grpc/impl/channel_arg_names.h +371 -0
  6. data/include/grpc/impl/grpc_types.h +1 -353
  7. data/include/grpc/module.modulemap +1 -0
  8. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
  9. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +2 -1
  10. data/src/core/ext/filters/client_channel/client_channel.cc +7 -3
  11. data/src/core/ext/filters/client_channel/http_proxy.cc +1 -1
  12. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
  13. data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
  14. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
  15. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +5 -3
  16. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +4 -2
  17. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +115 -109
  18. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +0 -5
  19. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +7 -2
  20. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -1
  21. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
  22. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +1 -1
  23. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +11 -3
  24. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +6 -1
  25. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +8 -5
  26. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
  27. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +102 -11
  28. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +9 -4
  29. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -1
  30. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.cc +6 -0
  31. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +41 -14
  32. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
  33. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +3 -2
  34. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
  35. data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
  36. data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -1
  37. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +1 -1
  38. data/src/core/ext/filters/client_channel/subchannel.cc +9 -5
  39. data/src/core/ext/filters/client_channel/subchannel.h +8 -2
  40. data/src/core/ext/filters/deadline/deadline_filter.cc +1 -1
  41. data/src/core/ext/filters/http/client/http_client_filter.cc +1 -0
  42. data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
  43. data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -0
  44. data/src/core/ext/filters/http/server/http_server_filter.cc +1 -1
  45. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -0
  46. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +4 -7
  47. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -0
  48. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -12
  49. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +357 -358
  50. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -18
  51. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +63 -4
  52. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +7 -2
  53. data/src/core/ext/transport/chttp2/transport/internal.h +30 -57
  54. data/src/core/ext/transport/chttp2/transport/parsing.cc +16 -7
  55. data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +80 -0
  56. data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +55 -0
  57. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +98 -0
  58. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +73 -0
  59. data/src/core/ext/transport/chttp2/transport/writing.cc +81 -89
  60. data/src/core/ext/transport/inproc/inproc_transport.cc +1 -0
  61. data/src/core/ext/xds/xds_client_grpc.cc +1 -0
  62. data/src/core/ext/xds/xds_http_fault_filter.cc +1 -2
  63. data/src/core/ext/xds/xds_http_fault_filter.h +1 -2
  64. data/src/core/ext/xds/xds_http_filters.h +2 -4
  65. data/src/core/ext/xds/xds_http_rbac_filter.cc +3 -8
  66. data/src/core/ext/xds/xds_http_rbac_filter.h +1 -2
  67. data/src/core/ext/xds/xds_http_stateful_session_filter.cc +1 -2
  68. data/src/core/ext/xds/xds_http_stateful_session_filter.h +1 -2
  69. data/src/core/ext/xds/xds_lb_policy_registry.cc +3 -6
  70. data/src/core/ext/xds/xds_routing.cc +2 -2
  71. data/src/core/ext/xds/xds_transport_grpc.cc +1 -0
  72. data/src/core/lib/avl/avl.h +10 -173
  73. data/src/core/lib/channel/call_tracer.cc +289 -0
  74. data/src/core/lib/channel/call_tracer.h +35 -0
  75. data/src/core/lib/channel/channel_args.cc +84 -79
  76. data/src/core/lib/channel/channel_args.h +29 -17
  77. data/src/core/lib/channel/connected_channel.cc +0 -1
  78. data/src/core/lib/channel/promise_based_filter.cc +4 -1
  79. data/src/core/lib/compression/compression_internal.cc +8 -4
  80. data/src/core/lib/debug/stats_data.cc +93 -21
  81. data/src/core/lib/debug/stats_data.h +41 -0
  82. data/src/core/lib/event_engine/ares_resolver.cc +712 -0
  83. data/src/core/lib/event_engine/ares_resolver.h +150 -0
  84. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +9 -3
  85. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +2 -2
  86. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +229 -0
  87. data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +117 -0
  88. data/src/core/lib/event_engine/forkable.cc +15 -1
  89. data/src/core/lib/event_engine/forkable.h +15 -0
  90. data/src/core/lib/event_engine/grpc_polled_fd.h +73 -0
  91. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +25 -3
  92. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +10 -1
  93. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +197 -0
  94. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +3 -3
  95. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +47 -1
  96. data/src/core/lib/event_engine/posix_engine/posix_engine.h +12 -1
  97. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -0
  98. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +2 -0
  99. data/src/core/lib/event_engine/thread_pool/thread_count.cc +58 -0
  100. data/src/core/lib/event_engine/thread_pool/thread_count.h +161 -0
  101. data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +7 -0
  102. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +86 -111
  103. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +15 -61
  104. data/src/core/lib/event_engine/windows/windows_endpoint.cc +3 -4
  105. data/src/core/lib/experiments/config.cc +14 -0
  106. data/src/core/lib/experiments/experiments.cc +141 -304
  107. data/src/core/lib/experiments/experiments.h +16 -17
  108. data/src/core/lib/gprpp/ref_counted.h +3 -1
  109. data/src/core/lib/gprpp/ref_counted_string.cc +44 -0
  110. data/src/core/lib/gprpp/ref_counted_string.h +146 -0
  111. data/src/core/lib/gprpp/time.h +2 -2
  112. data/src/core/lib/gprpp/work_serializer.cc +36 -0
  113. data/src/core/lib/gprpp/work_serializer.h +5 -0
  114. data/src/core/lib/http/httpcli_security_connector.cc +1 -0
  115. data/src/core/lib/iomgr/buffer_list.cc +2 -0
  116. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +7 -22
  117. data/src/core/lib/iomgr/tcp_posix.cc +3 -3
  118. data/src/core/lib/promise/detail/basic_seq.h +1 -372
  119. data/src/core/lib/promise/detail/seq_state.h +2076 -0
  120. data/src/core/lib/promise/seq.h +19 -2
  121. data/src/core/lib/promise/sleep.h +5 -10
  122. data/src/core/lib/promise/try_seq.h +34 -2
  123. data/src/core/lib/resource_quota/api.cc +1 -0
  124. data/src/core/lib/resource_quota/arena.cc +2 -0
  125. data/src/core/lib/resource_quota/arena.h +42 -8
  126. data/src/core/lib/resource_quota/memory_quota.cc +0 -1
  127. data/src/core/lib/resource_quota/resource_quota.h +1 -0
  128. data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
  129. data/src/core/lib/security/authorization/rbac_policy.h +1 -1
  130. data/src/core/lib/security/credentials/external/aws_request_signer.cc +8 -0
  131. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -0
  132. data/src/core/lib/security/credentials/jwt/json_token.cc +17 -0
  133. data/src/core/lib/security/credentials/jwt/json_token.h +4 -0
  134. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +42 -0
  135. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -0
  136. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -0
  137. data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -0
  138. data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -0
  139. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -0
  140. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
  141. data/src/core/lib/security/security_connector/ssl_utils.cc +1 -0
  142. data/src/core/lib/security/transport/client_auth_filter.cc +8 -5
  143. data/src/core/lib/security/transport/security_handshaker.cc +1 -0
  144. data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
  145. data/src/core/lib/surface/call.cc +32 -8
  146. data/src/core/lib/surface/channel.cc +1 -0
  147. data/src/core/lib/surface/completion_queue.cc +10 -0
  148. data/src/core/lib/surface/init.cc +1 -0
  149. data/src/core/lib/surface/server.cc +67 -64
  150. data/src/core/lib/surface/server.h +1 -15
  151. data/src/core/lib/surface/version.cc +2 -2
  152. data/src/core/tsi/alts/crypt/aes_gcm.cc +27 -2
  153. data/src/core/tsi/ssl_transport_security.cc +11 -0
  154. data/src/ruby/lib/grpc/generic/active_call.rb +9 -14
  155. data/src/ruby/lib/grpc/version.rb +1 -1
  156. data/src/ruby/pb/test/client.rb +16 -0
  157. data/src/ruby/spec/generic/rpc_server_spec.rb +3 -3
  158. data/third_party/abseil-cpp/absl/algorithm/container.h +3 -2
  159. data/third_party/abseil-cpp/absl/base/attributes.h +58 -5
  160. data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
  161. data/third_party/abseil-cpp/absl/base/casts.h +8 -8
  162. data/third_party/abseil-cpp/absl/base/config.h +89 -106
  163. data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +26 -1
  164. data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -2
  165. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +50 -39
  166. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +2 -1
  167. data/third_party/abseil-cpp/absl/base/internal/prefetch.h +17 -18
  168. data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +32 -3
  169. data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +24 -4
  170. data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +31 -73
  171. data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -8
  172. data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +11 -11
  173. data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +23 -32
  174. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +2 -3
  175. data/third_party/abseil-cpp/absl/base/options.h +1 -1
  176. data/third_party/abseil-cpp/absl/base/policy_checks.h +3 -3
  177. data/third_party/abseil-cpp/absl/base/prefetch.h +198 -0
  178. data/third_party/abseil-cpp/absl/container/fixed_array.h +54 -29
  179. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -1
  180. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -2
  181. data/third_party/abseil-cpp/absl/container/inlined_vector.h +167 -79
  182. data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
  183. data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +3 -21
  184. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +1 -1
  185. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +46 -0
  186. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -0
  187. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +85 -26
  188. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +35 -18
  189. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +70 -29
  190. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +437 -236
  191. data/third_party/abseil-cpp/absl/crc/crc32c.h +8 -1
  192. data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +14 -8
  193. data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -35
  194. data/third_party/abseil-cpp/absl/crc/internal/crc.h +2 -10
  195. data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +1 -1
  196. data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +1 -1
  197. data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +4 -4
  198. data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +8 -10
  199. data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +17 -19
  200. data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +8 -8
  201. data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +2 -1
  202. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +59 -23
  203. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +1 -1
  204. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +1 -1
  205. data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +1 -1
  206. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +43 -19
  207. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -0
  208. data/third_party/abseil-cpp/absl/flags/commandlineflag.h +1 -1
  209. data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc +1 -1
  210. data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -2
  211. data/third_party/abseil-cpp/absl/flags/internal/flag.h +16 -15
  212. data/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc +1 -1
  213. data/third_party/abseil-cpp/absl/flags/marshalling.cc +43 -2
  214. data/third_party/abseil-cpp/absl/flags/marshalling.h +5 -0
  215. data/third_party/abseil-cpp/absl/functional/any_invocable.h +9 -1
  216. data/third_party/abseil-cpp/absl/functional/bind_front.h +1 -1
  217. data/third_party/abseil-cpp/absl/functional/function_ref.h +3 -3
  218. data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +37 -24
  219. data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +19 -9
  220. data/third_party/abseil-cpp/absl/hash/hash.h +7 -4
  221. data/third_party/abseil-cpp/absl/hash/internal/hash.h +38 -15
  222. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +6 -0
  223. data/third_party/abseil-cpp/absl/meta/type_traits.h +48 -373
  224. data/third_party/abseil-cpp/absl/numeric/bits.h +4 -4
  225. data/third_party/abseil-cpp/absl/numeric/int128.cc +20 -8
  226. data/third_party/abseil-cpp/absl/numeric/int128.h +36 -39
  227. data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +0 -3
  228. data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +47 -30
  229. data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +4 -3
  230. data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
  231. data/third_party/abseil-cpp/absl/random/internal/platform.h +1 -1
  232. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +4 -0
  233. data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +1 -1
  234. data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +1 -1
  235. data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +1 -1
  236. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +4 -0
  237. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +12 -24
  238. data/third_party/abseil-cpp/absl/status/status.cc +11 -7
  239. data/third_party/abseil-cpp/absl/status/status.h +11 -2
  240. data/third_party/abseil-cpp/absl/status/statusor.h +22 -8
  241. data/third_party/abseil-cpp/absl/strings/ascii.cc +54 -6
  242. data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -4
  243. data/third_party/abseil-cpp/absl/strings/charconv.h +2 -2
  244. data/third_party/abseil-cpp/absl/strings/cord.cc +1 -2
  245. data/third_party/abseil-cpp/absl/strings/cord.h +32 -5
  246. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +23 -1
  247. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +18 -0
  248. data/third_party/abseil-cpp/absl/strings/cord_buffer.h +2 -5
  249. data/third_party/abseil-cpp/absl/strings/escaping.cc +10 -32
  250. data/third_party/abseil-cpp/absl/strings/escaping.h +1 -1
  251. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +2 -4
  252. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +3 -3
  253. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +0 -1
  254. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +15 -13
  255. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +13 -4
  256. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +8 -0
  257. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +5 -3
  258. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +4 -7
  259. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +8 -0
  260. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +2 -2
  261. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +46 -20
  262. data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +1 -34
  263. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +2 -1
  264. data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +23 -0
  265. data/third_party/abseil-cpp/absl/strings/internal/escaping.h +1 -0
  266. data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +2 -77
  267. data/third_party/abseil-cpp/absl/strings/internal/memutil.h +4 -112
  268. data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +1 -1
  269. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +10 -31
  270. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -8
  271. data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +5 -20
  272. data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +1 -0
  273. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +1 -1
  274. data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +9 -9
  275. data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +56 -6
  276. data/third_party/abseil-cpp/absl/strings/match.cc +87 -0
  277. data/third_party/abseil-cpp/absl/strings/match.h +19 -0
  278. data/third_party/abseil-cpp/absl/strings/numbers.cc +154 -122
  279. data/third_party/abseil-cpp/absl/strings/numbers.h +1 -6
  280. data/third_party/abseil-cpp/absl/strings/str_cat.cc +7 -50
  281. data/third_party/abseil-cpp/absl/strings/str_cat.h +83 -15
  282. data/third_party/abseil-cpp/absl/strings/str_format.h +6 -3
  283. data/third_party/abseil-cpp/absl/strings/str_split.cc +9 -6
  284. data/third_party/abseil-cpp/absl/strings/string_view.cc +26 -4
  285. data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +5 -0
  286. data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +63 -43
  287. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +111 -0
  288. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
  289. data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +11 -7
  290. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +225 -0
  291. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +122 -114
  292. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +12 -8
  293. data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +10 -1
  294. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +167 -0
  295. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
  296. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +122 -0
  297. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
  298. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +91 -0
  299. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
  300. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +19 -113
  301. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +42 -0
  302. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
  303. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +151 -0
  304. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.h +70 -0
  305. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +407 -411
  306. data/third_party/abseil-cpp/absl/synchronization/mutex.h +152 -118
  307. data/third_party/abseil-cpp/absl/time/clock.cc +6 -7
  308. data/third_party/abseil-cpp/absl/time/duration.cc +24 -26
  309. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -0
  310. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
  311. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +3 -3
  312. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +8 -6
  313. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +6 -3
  314. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +4 -2
  315. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +4 -0
  316. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +322 -295
  317. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +8 -17
  318. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +51 -33
  319. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +7 -2
  320. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +128 -2
  321. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +1 -1
  322. data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +5 -1
  323. data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +34 -34
  324. data/third_party/abseil-cpp/absl/time/time.cc +9 -2
  325. data/third_party/abseil-cpp/absl/time/time.h +115 -15
  326. data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -52
  327. data/third_party/abseil-cpp/absl/types/internal/span.h +2 -2
  328. data/third_party/abseil-cpp/absl/types/internal/variant.h +2 -2
  329. data/third_party/abseil-cpp/absl/types/optional.h +15 -13
  330. data/third_party/abseil-cpp/absl/types/span.h +1 -2
  331. data/third_party/boringssl-with-bazel/err_data.c +15 -14
  332. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +7 -3
  333. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c +7 -7
  334. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +7 -3
  335. data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +5 -5
  336. data/third_party/boringssl-with-bazel/src/crypto/bio/errno.c +92 -0
  337. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +4 -48
  338. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +11 -6
  339. data/third_party/boringssl-with-bazel/src/crypto/bio/internal.h +16 -6
  340. data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +2 -2
  341. data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +9 -0
  342. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +1 -1
  343. data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +3 -7
  344. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +0 -2
  345. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c +0 -1
  346. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.c +0 -2
  347. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c +0 -1
  348. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.c +93 -0
  349. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.c +1 -1
  350. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c +0 -1
  351. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +0 -2
  352. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c +4 -0
  353. data/third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c +5 -0
  354. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +9 -14
  355. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +4 -6
  356. data/third_party/boringssl-with-bazel/src/crypto/err/err.c +10 -11
  357. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/check.c +37 -8
  358. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +38 -19
  359. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +7 -0
  360. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +39 -16
  361. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/service_indicator.c +4 -7
  362. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +7 -0
  363. data/third_party/boringssl-with-bazel/src/crypto/internal.h +13 -21
  364. data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +6 -23
  365. data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +4 -0
  366. data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +5 -0
  367. data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -6
  368. data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +0 -3
  369. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c +1 -3
  370. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +2 -3
  371. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +9 -1
  372. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +11 -1
  373. data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -1
  374. data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +7 -9
  375. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +6 -2
  376. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +22 -20
  377. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +4 -0
  378. data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +20 -12
  379. data/third_party/boringssl-with-bazel/src/include/openssl/target.h +50 -3
  380. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +0 -4
  381. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
  382. data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +4 -4
  383. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +2 -0
  384. metadata +41 -33
  385. data/src/core/lib/promise/detail/basic_join.h +0 -197
  386. data/src/core/lib/promise/detail/switch.h +0 -1455
  387. data/src/core/lib/promise/try_join.h +0 -82
  388. data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -403
  389. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_freebsd.c +0 -62
  390. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm.c +0 -38
  391. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_openbsd.c +0 -31
  392. data/third_party/re2/util/benchmark.h +0 -156
  393. data/third_party/re2/util/flags.h +0 -26
  394. data/third_party/re2/util/malloc_counter.h +0 -19
  395. data/third_party/re2/util/pcre.cc +0 -1025
  396. data/third_party/re2/util/pcre.h +0 -681
  397. data/third_party/re2/util/test.h +0 -50
  398. data/third_party/upb/upb/mini_table.h +0 -36
  399. data/third_party/zlib/gzclose.c +0 -25
  400. data/third_party/zlib/gzlib.c +0 -639
  401. data/third_party/zlib/gzread.c +0 -650
  402. data/third_party/zlib/gzwrite.c +0 -677
@@ -84,6 +84,7 @@ struct timeval;
84
84
  #include <type_traits>
85
85
  #include <utility>
86
86
 
87
+ #include "absl/base/config.h"
87
88
  #include "absl/base/macros.h"
88
89
  #include "absl/strings/string_view.h"
89
90
  #include "absl/time/civil_time.h"
@@ -187,7 +188,12 @@ class Duration {
187
188
  Duration& operator%=(Duration rhs);
188
189
 
189
190
  // Overloads that forward to either the int64_t or double overloads above.
190
- // Integer operands must be representable as int64_t.
191
+ // Integer operands must be representable as int64_t. Integer division is
192
+ // truncating, so values less than the resolution will be returned as zero.
193
+ // Floating-point multiplication and division is rounding (halfway cases
194
+ // rounding away from zero), so values less than the resolution may be
195
+ // returned as either the resolution or zero. In particular, `d / 2.0`
196
+ // can produce `d` when it is the resolution and "even".
191
197
  template <typename T, time_internal::EnableIfIntegral<T> = 0>
192
198
  Duration& operator*=(T r) {
193
199
  int64_t x = r;
@@ -214,7 +220,7 @@ class Duration {
214
220
 
215
221
  template <typename H>
216
222
  friend H AbslHashValue(H h, Duration d) {
217
- return H::combine(std::move(h), d.rep_hi_, d.rep_lo_);
223
+ return H::combine(std::move(h), d.rep_hi_.Get(), d.rep_lo_);
218
224
  }
219
225
 
220
226
  private:
@@ -223,7 +229,79 @@ class Duration {
223
229
  friend constexpr Duration time_internal::MakeDuration(int64_t hi,
224
230
  uint32_t lo);
225
231
  constexpr Duration(int64_t hi, uint32_t lo) : rep_hi_(hi), rep_lo_(lo) {}
226
- int64_t rep_hi_;
232
+
233
+ // We store `rep_hi_` 4-byte rather than 8-byte aligned to avoid 4 bytes of
234
+ // tail padding.
235
+ class HiRep {
236
+ public:
237
+ // Default constructor default-initializes `hi_`, which has the same
238
+ // semantics as default-initializing an `int64_t` (undetermined value).
239
+ HiRep() = default;
240
+
241
+ HiRep(const HiRep&) = default;
242
+ HiRep& operator=(const HiRep&) = default;
243
+
244
+ explicit constexpr HiRep(const int64_t value)
245
+ : // C++17 forbids default-initialization in constexpr contexts. We can
246
+ // remove this in C++20.
247
+ #if defined(ABSL_IS_BIG_ENDIAN) && ABSL_IS_BIG_ENDIAN
248
+ hi_(0),
249
+ lo_(0)
250
+ #else
251
+ lo_(0),
252
+ hi_(0)
253
+ #endif
254
+ {
255
+ *this = value;
256
+ }
257
+
258
+ constexpr int64_t Get() const {
259
+ const uint64_t unsigned_value =
260
+ (static_cast<uint64_t>(hi_) << 32) | static_cast<uint64_t>(lo_);
261
+ // `static_cast<int64_t>(unsigned_value)` is implementation-defined
262
+ // before c++20. On all supported platforms the behaviour is that mandated
263
+ // by c++20, i.e. "If the destination type is signed, [...] the result is
264
+ // the unique value of the destination type equal to the source value
265
+ // modulo 2^n, where n is the number of bits used to represent the
266
+ // destination type."
267
+ static_assert(
268
+ (static_cast<int64_t>((std::numeric_limits<uint64_t>::max)()) ==
269
+ int64_t{-1}) &&
270
+ (static_cast<int64_t>(static_cast<uint64_t>(
271
+ (std::numeric_limits<int64_t>::max)()) +
272
+ 1) ==
273
+ (std::numeric_limits<int64_t>::min)()),
274
+ "static_cast<int64_t>(uint64_t) does not have c++20 semantics");
275
+ return static_cast<int64_t>(unsigned_value);
276
+ }
277
+
278
+ constexpr HiRep& operator=(const int64_t value) {
279
+ // "If the destination type is unsigned, the resulting value is the
280
+ // smallest unsigned value equal to the source value modulo 2^n
281
+ // where `n` is the number of bits used to represent the destination
282
+ // type".
283
+ const auto unsigned_value = static_cast<uint64_t>(value);
284
+ hi_ = static_cast<uint32_t>(unsigned_value >> 32);
285
+ lo_ = static_cast<uint32_t>(unsigned_value);
286
+ return *this;
287
+ }
288
+
289
+ private:
290
+ // Notes:
291
+ // - Ideally we would use a `char[]` and `std::bitcast`, but the latter
292
+ // does not exist (and is not constexpr in `absl`) before c++20.
293
+ // - Order is optimized depending on endianness so that the compiler can
294
+ // turn `Get()` (resp. `operator=()`) into a single 8-byte load (resp.
295
+ // store).
296
+ #if defined(ABSL_IS_BIG_ENDIAN) && ABSL_IS_BIG_ENDIAN
297
+ uint32_t hi_;
298
+ uint32_t lo_;
299
+ #else
300
+ uint32_t lo_;
301
+ uint32_t hi_;
302
+ #endif
303
+ };
304
+ HiRep rep_hi_;
227
305
  uint32_t rep_lo_;
228
306
  };
229
307
 
@@ -609,6 +687,12 @@ inline std::ostream& operator<<(std::ostream& os, Duration d) {
609
687
  return os << FormatDuration(d);
610
688
  }
611
689
 
690
+ // Support for StrFormat(), StrCat() etc.
691
+ template <typename Sink>
692
+ void AbslStringify(Sink& sink, Duration d) {
693
+ sink.Append(FormatDuration(d));
694
+ }
695
+
612
696
  // ParseDuration()
613
697
  //
614
698
  // Parses a duration string consisting of a possibly signed sequence of
@@ -718,8 +802,7 @@ class Time {
718
802
  // `absl::TimeZone`.
719
803
  //
720
804
  // Deprecated. Use `absl::TimeZone::CivilInfo`.
721
- struct
722
- Breakdown {
805
+ struct ABSL_DEPRECATED("Use `absl::TimeZone::CivilInfo`.") Breakdown {
723
806
  int64_t year; // year (e.g., 2013)
724
807
  int month; // month of year [1:12]
725
808
  int day; // day of month [1:31]
@@ -745,7 +828,10 @@ class Time {
745
828
  // Returns the breakdown of this instant in the given TimeZone.
746
829
  //
747
830
  // Deprecated. Use `absl::TimeZone::At(Time)`.
831
+ ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
832
+ ABSL_DEPRECATED("Use `absl::TimeZone::At(Time)`.")
748
833
  Breakdown In(TimeZone tz) const;
834
+ ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
749
835
 
750
836
  template <typename H>
751
837
  friend H AbslHashValue(H h, Time t) {
@@ -839,7 +925,8 @@ ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time InfinitePast() {
839
925
  // FromUDate()
840
926
  // FromUniversal()
841
927
  //
842
- // Creates an `absl::Time` from a variety of other representations.
928
+ // Creates an `absl::Time` from a variety of other representations. See
929
+ // https://unicode-org.github.io/icu/userguide/datetime/universaltimescale.html
843
930
  ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixNanos(int64_t ns);
844
931
  ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMicros(int64_t us);
845
932
  ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMillis(int64_t ms);
@@ -856,10 +943,12 @@ ABSL_ATTRIBUTE_CONST_FUNCTION Time FromUniversal(int64_t universal);
856
943
  // ToUDate()
857
944
  // ToUniversal()
858
945
  //
859
- // Converts an `absl::Time` to a variety of other representations. Note that
860
- // these operations round down toward negative infinity where necessary to
861
- // adjust to the resolution of the result type. Beware of possible time_t
862
- // over/underflow in ToTime{T,val,spec}() on 32-bit platforms.
946
+ // Converts an `absl::Time` to a variety of other representations. See
947
+ // https://unicode-org.github.io/icu/userguide/datetime/universaltimescale.html
948
+ //
949
+ // Note that these operations round down toward negative infinity where
950
+ // necessary to adjust to the resolution of the result type. Beware of
951
+ // possible time_t over/underflow in ToTime{T,val,spec}() on 32-bit platforms.
863
952
  ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixNanos(Time t);
864
953
  ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixMicros(Time t);
865
954
  ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixMillis(Time t);
@@ -1236,8 +1325,7 @@ ABSL_ATTRIBUTE_PURE_FUNCTION inline Time FromCivil(CivilSecond ct,
1236
1325
  // `absl::ConvertDateTime()`. Legacy version of `absl::TimeZone::TimeInfo`.
1237
1326
  //
1238
1327
  // Deprecated. Use `absl::TimeZone::TimeInfo`.
1239
- struct
1240
- TimeConversion {
1328
+ struct ABSL_DEPRECATED("Use `absl::TimeZone::TimeInfo`.") TimeConversion {
1241
1329
  Time pre; // time calculated using the pre-transition offset
1242
1330
  Time trans; // when the civil-time discontinuity occurred
1243
1331
  Time post; // time calculated using the post-transition offset
@@ -1271,8 +1359,11 @@ struct
1271
1359
  // // absl::ToCivilDay(tc.pre, tz).day() == 1
1272
1360
  //
1273
1361
  // Deprecated. Use `absl::TimeZone::At(CivilSecond)`.
1362
+ ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
1363
+ ABSL_DEPRECATED("Use `absl::TimeZone::At(CivilSecond)`.")
1274
1364
  TimeConversion ConvertDateTime(int64_t year, int mon, int day, int hour,
1275
1365
  int min, int sec, TimeZone tz);
1366
+ ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
1276
1367
 
1277
1368
  // FromDateTime()
1278
1369
  //
@@ -1289,9 +1380,12 @@ TimeConversion ConvertDateTime(int64_t year, int mon, int day, int hour,
1289
1380
  // Deprecated. Use `absl::FromCivil(CivilSecond, TimeZone)`. Note that the
1290
1381
  // behavior of `FromCivil()` differs from `FromDateTime()` for skipped civil
1291
1382
  // times. If you care about that see `absl::TimeZone::At(absl::CivilSecond)`.
1292
- inline Time FromDateTime(int64_t year, int mon, int day, int hour,
1293
- int min, int sec, TimeZone tz) {
1383
+ ABSL_DEPRECATED("Use `absl::FromCivil(CivilSecond, TimeZone)`.")
1384
+ inline Time FromDateTime(int64_t year, int mon, int day, int hour, int min,
1385
+ int sec, TimeZone tz) {
1386
+ ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING
1294
1387
  return ConvertDateTime(year, mon, day, hour, min, sec, tz).pre;
1388
+ ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
1295
1389
  }
1296
1390
 
1297
1391
  // FromTM()
@@ -1386,6 +1480,12 @@ inline std::ostream& operator<<(std::ostream& os, Time t) {
1386
1480
  return os << FormatTime(t);
1387
1481
  }
1388
1482
 
1483
+ // Support for StrFormat(), StrCat() etc.
1484
+ template <typename Sink>
1485
+ void AbslStringify(Sink& sink, Time t) {
1486
+ sink.Append(FormatTime(t));
1487
+ }
1488
+
1389
1489
  // ParseTime()
1390
1490
  //
1391
1491
  // Parses an input string according to the provided format string and
@@ -1491,7 +1591,7 @@ ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Duration MakeNormalizedDuration(
1491
1591
 
1492
1592
  // Provide access to the Duration representation.
1493
1593
  ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t GetRepHi(Duration d) {
1494
- return d.rep_hi_;
1594
+ return d.rep_hi_.Get();
1495
1595
  }
1496
1596
  ABSL_ATTRIBUTE_CONST_FUNCTION constexpr uint32_t GetRepLo(Duration d) {
1497
1597
  return d.rep_lo_;
@@ -25,34 +25,6 @@
25
25
  #include "absl/meta/type_traits.h"
26
26
  #include "absl/utility/utility.h"
27
27
 
28
- // ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS
29
- //
30
- // Inheriting constructors is supported in GCC 4.8+, Clang 3.3+ and MSVC 2015.
31
- // __cpp_inheriting_constructors is a predefined macro and a recommended way to
32
- // check for this language feature, but GCC doesn't support it until 5.0 and
33
- // Clang doesn't support it until 3.6.
34
- // Also, MSVC 2015 has a bug: it doesn't inherit the constexpr template
35
- // constructor. For example, the following code won't work on MSVC 2015 Update3:
36
- // struct Base {
37
- // int t;
38
- // template <typename T>
39
- // constexpr Base(T t_) : t(t_) {}
40
- // };
41
- // struct Foo : Base {
42
- // using Base::Base;
43
- // }
44
- // constexpr Foo foo(0); // doesn't work on MSVC 2015
45
- #if defined(__clang__)
46
- #if __has_feature(cxx_inheriting_constructors)
47
- #define ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS 1
48
- #endif
49
- #elif (defined(__GNUC__) && \
50
- (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 8)) || \
51
- (__cpp_inheriting_constructors >= 200802) || \
52
- (defined(_MSC_VER) && _MSC_VER >= 1910)
53
- #define ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS 1
54
- #endif
55
-
56
28
  namespace absl {
57
29
  ABSL_NAMESPACE_BEGIN
58
30
 
@@ -145,15 +117,7 @@ template <typename T>
145
117
  class optional_data_base : public optional_data_dtor_base<T> {
146
118
  protected:
147
119
  using base = optional_data_dtor_base<T>;
148
- #ifdef ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS
149
120
  using base::base;
150
- #else
151
- optional_data_base() = default;
152
-
153
- template <typename... Args>
154
- constexpr explicit optional_data_base(in_place_t t, Args&&... args)
155
- : base(t, absl::forward<Args>(args)...) {}
156
- #endif
157
121
 
158
122
  template <typename... Args>
159
123
  void construct(Args&&... args) {
@@ -188,27 +152,13 @@ class optional_data;
188
152
  template <typename T>
189
153
  class optional_data<T, true> : public optional_data_base<T> {
190
154
  protected:
191
- #ifdef ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS
192
155
  using optional_data_base<T>::optional_data_base;
193
- #else
194
- optional_data() = default;
195
-
196
- template <typename... Args>
197
- constexpr explicit optional_data(in_place_t t, Args&&... args)
198
- : optional_data_base<T>(t, absl::forward<Args>(args)...) {}
199
- #endif
200
156
  };
201
157
 
202
158
  template <typename T>
203
159
  class optional_data<T, false> : public optional_data_base<T> {
204
160
  protected:
205
- #ifdef ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS
206
161
  using optional_data_base<T>::optional_data_base;
207
- #else
208
- template <typename... Args>
209
- constexpr explicit optional_data(in_place_t t, Args&&... args)
210
- : optional_data_base<T>(t, absl::forward<Args>(args)...) {}
211
- #endif
212
162
 
213
163
  optional_data() = default;
214
164
 
@@ -399,6 +349,4 @@ struct optional_hash_base<T, decltype(std::hash<absl::remove_const_t<T> >()(
399
349
  ABSL_NAMESPACE_END
400
350
  } // namespace absl
401
351
 
402
- #undef ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS
403
-
404
352
  #endif // ABSL_TYPES_INTERNAL_OPTIONAL_H_
@@ -88,7 +88,7 @@ using EnableIfMutable =
88
88
  template <template <typename> class SpanT, typename T>
89
89
  bool EqualImpl(SpanT<T> a, SpanT<T> b) {
90
90
  static_assert(std::is_const<T>::value, "");
91
- return absl::equal(a.begin(), a.end(), b.begin(), b.end());
91
+ return std::equal(a.begin(), a.end(), b.begin(), b.end());
92
92
  }
93
93
 
94
94
  template <template <typename> class SpanT, typename T>
@@ -125,7 +125,7 @@ struct IsView<
125
125
  };
126
126
 
127
127
  // These enablers result in 'int' so they can be used as typenames or defaults
128
- // in template paramters lists.
128
+ // in template parameters lists.
129
129
  template <typename T>
130
130
  using EnableIfIsView = std::enable_if_t<IsView<T>::value, int>;
131
131
 
@@ -877,8 +877,8 @@ struct IndexOfConstructedType<
877
877
  template <std::size_t... Is>
878
878
  struct ContainsVariantNPos
879
879
  : absl::negation<std::is_same< // NOLINT
880
- absl::integer_sequence<bool, 0 <= Is...>,
881
- absl::integer_sequence<bool, Is != absl::variant_npos...>>> {};
880
+ std::integer_sequence<bool, 0 <= Is...>,
881
+ std::integer_sequence<bool, Is != absl::variant_npos...>>> {};
882
882
 
883
883
  template <class Op, class... QualifiedVariants>
884
884
  using RawVisitResult =
@@ -130,7 +130,7 @@ class optional : private optional_internal::optional_data<T>,
130
130
 
131
131
  // Constructs an `optional` holding an empty value, NOT a default constructed
132
132
  // `T`.
133
- constexpr optional() noexcept {}
133
+ constexpr optional() noexcept = default;
134
134
 
135
135
  // Constructs an `optional` initialized with `nullopt` to hold an empty value.
136
136
  constexpr optional(nullopt_t) noexcept {} // NOLINT(runtime/explicit)
@@ -357,7 +357,7 @@ class optional : private optional_internal::optional_data<T>,
357
357
  template <typename... Args,
358
358
  typename = typename std::enable_if<
359
359
  std::is_constructible<T, Args&&...>::value>::type>
360
- T& emplace(Args&&... args) {
360
+ T& emplace(Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
361
361
  this->destruct();
362
362
  this->construct(std::forward<Args>(args)...);
363
363
  return reference();
@@ -377,7 +377,8 @@ class optional : private optional_internal::optional_data<T>,
377
377
  template <typename U, typename... Args,
378
378
  typename = typename std::enable_if<std::is_constructible<
379
379
  T, std::initializer_list<U>&, Args&&...>::value>::type>
380
- T& emplace(std::initializer_list<U> il, Args&&... args) {
380
+ T& emplace(std::initializer_list<U> il,
381
+ Args&&... args) ABSL_ATTRIBUTE_LIFETIME_BOUND {
381
382
  this->destruct();
382
383
  this->construct(il, std::forward<Args>(args)...);
383
384
  return reference();
@@ -414,11 +415,11 @@ class optional : private optional_internal::optional_data<T>,
414
415
  // `optional` is empty, behavior is undefined.
415
416
  //
416
417
  // If you need myOpt->foo in constexpr, use (*myOpt).foo instead.
417
- const T* operator->() const {
418
+ const T* operator->() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
418
419
  ABSL_HARDENING_ASSERT(this->engaged_);
419
420
  return std::addressof(this->data_);
420
421
  }
421
- T* operator->() {
422
+ T* operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND {
422
423
  ABSL_HARDENING_ASSERT(this->engaged_);
423
424
  return std::addressof(this->data_);
424
425
  }
@@ -427,17 +428,17 @@ class optional : private optional_internal::optional_data<T>,
427
428
  //
428
429
  // Accesses the underlying `T` value of an `optional`. If the `optional` is
429
430
  // empty, behavior is undefined.
430
- constexpr const T& operator*() const& {
431
+ constexpr const T& operator*() const& ABSL_ATTRIBUTE_LIFETIME_BOUND {
431
432
  return ABSL_HARDENING_ASSERT(this->engaged_), reference();
432
433
  }
433
- T& operator*() & {
434
+ T& operator*() & ABSL_ATTRIBUTE_LIFETIME_BOUND {
434
435
  ABSL_HARDENING_ASSERT(this->engaged_);
435
436
  return reference();
436
437
  }
437
- constexpr const T&& operator*() const && {
438
+ constexpr const T&& operator*() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND {
438
439
  return ABSL_HARDENING_ASSERT(this->engaged_), absl::move(reference());
439
440
  }
440
- T&& operator*() && {
441
+ T&& operator*() && ABSL_ATTRIBUTE_LIFETIME_BOUND {
441
442
  ABSL_HARDENING_ASSERT(this->engaged_);
442
443
  return std::move(reference());
443
444
  }
@@ -472,23 +473,24 @@ class optional : private optional_internal::optional_data<T>,
472
473
  // and lvalue/rvalue-ness of the `optional` is preserved to the view of
473
474
  // the `T` sub-object. Throws `absl::bad_optional_access` when the `optional`
474
475
  // is empty.
475
- constexpr const T& value() const & {
476
+ constexpr const T& value() const& ABSL_ATTRIBUTE_LIFETIME_BOUND {
476
477
  return static_cast<bool>(*this)
477
478
  ? reference()
478
479
  : (optional_internal::throw_bad_optional_access(), reference());
479
480
  }
480
- T& value() & {
481
+ T& value() & ABSL_ATTRIBUTE_LIFETIME_BOUND {
481
482
  return static_cast<bool>(*this)
482
483
  ? reference()
483
484
  : (optional_internal::throw_bad_optional_access(), reference());
484
485
  }
485
- T&& value() && { // NOLINT(build/c++11)
486
+ T&& value() && ABSL_ATTRIBUTE_LIFETIME_BOUND { // NOLINT(build/c++11)
486
487
  return std::move(
487
488
  static_cast<bool>(*this)
488
489
  ? reference()
489
490
  : (optional_internal::throw_bad_optional_access(), reference()));
490
491
  }
491
- constexpr const T&& value() const && { // NOLINT(build/c++11)
492
+ constexpr const T&& value()
493
+ const&& ABSL_ATTRIBUTE_LIFETIME_BOUND { // NOLINT(build/c++11)
492
494
  return absl::move(
493
495
  static_cast<bool>(*this)
494
496
  ? reference()
@@ -296,8 +296,7 @@ class Span {
296
296
  //
297
297
  // Returns a reference to the i'th element of this span.
298
298
  constexpr reference operator[](size_type i) const noexcept {
299
- // MSVC 2015 accepts this as constexpr, but not ptr_[i]
300
- return ABSL_HARDENING_ASSERT(i < size()), *(data() + i);
299
+ return ABSL_HARDENING_ASSERT(i < size()), ptr_[i];
301
300
  }
302
301
 
303
302
  // Span::at()
@@ -81,7 +81,7 @@ const uint32_t kOpenSSLReasonValues[] = {
81
81
  0x10339666,
82
82
  0x10341679,
83
83
  0x10348f93,
84
- 0x10350ccc,
84
+ 0x10350cdf,
85
85
  0x1035968c,
86
86
  0x103616b6,
87
87
  0x103696c9,
@@ -103,7 +103,7 @@ const uint32_t kOpenSSLReasonValues[] = {
103
103
  0x103e9839,
104
104
  0x103f1850,
105
105
  0x103f9863,
106
- 0x10400c90,
106
+ 0x10400ca3,
107
107
  0x10409876,
108
108
  0x10411894,
109
109
  0x104198a7,
@@ -125,11 +125,12 @@ const uint32_t kOpenSSLReasonValues[] = {
125
125
  0x104997d7,
126
126
  0x104a16a1,
127
127
  0x14320c73,
128
- 0x14328c81,
129
- 0x14330c90,
130
- 0x14338ca2,
128
+ 0x14328c94,
129
+ 0x14330ca3,
130
+ 0x14338cb5,
131
131
  0x143400b9,
132
132
  0x143480f7,
133
+ 0x14350c81,
133
134
  0x18320090,
134
135
  0x18328fe9,
135
136
  0x183300b9,
@@ -163,7 +164,7 @@ const uint32_t kOpenSSLReasonValues[] = {
163
164
  0x18411164,
164
165
  0x1841912f,
165
166
  0x1842114e,
166
- 0x18428cd8,
167
+ 0x18428c81,
167
168
  0x1843110a,
168
169
  0x18439176,
169
170
  0x18441028,
@@ -185,14 +186,14 @@ const uint32_t kOpenSSLReasonValues[] = {
185
186
  0x2438133b,
186
187
  0x24389348,
187
188
  0x2439135b,
188
- 0x28320cc0,
189
+ 0x28320cd3,
189
190
  0x28328ceb,
190
- 0x28330c90,
191
+ 0x28330ca3,
191
192
  0x28338cfe,
192
- 0x28340ccc,
193
+ 0x28340cdf,
193
194
  0x283480b9,
194
195
  0x283500f7,
195
- 0x28358cd8,
196
+ 0x28358c81,
196
197
  0x2836099a,
197
198
  0x2c3232d0,
198
199
  0x2c329372,
@@ -676,7 +677,7 @@ const uint32_t kOpenSSLReasonValues[] = {
676
677
  0x4c3c1574,
677
678
  0x4c3c9583,
678
679
  0x4c3d159c,
679
- 0x4c3d8cb3,
680
+ 0x4c3d8cc6,
680
681
  0x4c3e1609,
681
682
  0x4c3e95ab,
682
683
  0x4c3f162b,
@@ -761,12 +762,12 @@ const uint32_t kOpenSSLReasonValues[] = {
761
762
  0x683480f7,
762
763
  0x6835099a,
763
764
  0x6c320f59,
764
- 0x6c328ca2,
765
+ 0x6c328cb5,
765
766
  0x6c330f64,
766
767
  0x6c338f7d,
767
768
  0x74320a66,
768
769
  0x743280b9,
769
- 0x74330cb3,
770
+ 0x74330cc6,
770
771
  0x783209cb,
771
772
  0x783289e0,
772
773
  0x783309ec,
@@ -981,13 +982,13 @@ const char kOpenSSLReasonStringData[] =
981
982
  "VARIABLE_EXPANSION_TOO_LONG\0"
982
983
  "VARIABLE_HAS_NO_VALUE\0"
983
984
  "BAD_GENERATOR\0"
985
+ "INVALID_PARAMETERS\0"
984
986
  "INVALID_PUBKEY\0"
985
987
  "MODULUS_TOO_LARGE\0"
986
988
  "NO_PRIVATE_VALUE\0"
987
989
  "UNKNOWN_HASH\0"
988
990
  "BAD_Q_VALUE\0"
989
991
  "BAD_VERSION\0"
990
- "INVALID_PARAMETERS\0"
991
992
  "MISSING_PARAMETERS\0"
992
993
  "NEED_NEW_SETUP_VALUES\0"
993
994
  "BIGNUM_OUT_OF_RANGE\0"
@@ -60,6 +60,7 @@
60
60
  #include <openssl/mem.h>
61
61
  #include <openssl/time.h>
62
62
 
63
+ #include <stdlib.h>
63
64
  #include <string.h>
64
65
  #include <time.h>
65
66
 
@@ -123,9 +124,12 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
123
124
  }
124
125
 
125
126
  char buf[16];
126
- BIO_snprintf(buf, sizeof(buf), "%04d%02d%02d%02d%02d%02dZ",
127
- data.tm_year + 1900, data.tm_mon + 1, data.tm_mday, data.tm_hour,
128
- data.tm_min, data.tm_sec);
127
+ int ret = snprintf(buf, sizeof(buf), "%04d%02d%02d%02d%02d%02dZ",
128
+ data.tm_year + 1900, data.tm_mon + 1, data.tm_mday,
129
+ data.tm_hour, data.tm_min, data.tm_sec);
130
+ if (ret != (int)(sizeof(buf) - 1)) {
131
+ abort(); // |snprintf| should neither truncate nor write fewer bytes.
132
+ }
129
133
 
130
134
  int free_s = 0;
131
135
  if (s == NULL) {
@@ -89,18 +89,18 @@ static int do_esc_char(uint32_t c, unsigned long flags, char *do_quotes,
89
89
  char buf[16]; // Large enough for "\\W01234567".
90
90
  unsigned char u8 = (unsigned char)c;
91
91
  if (c > 0xffff) {
92
- BIO_snprintf(buf, sizeof(buf), "\\W%08" PRIX32, c);
92
+ snprintf(buf, sizeof(buf), "\\W%08" PRIX32, c);
93
93
  } else if (c > 0xff) {
94
- BIO_snprintf(buf, sizeof(buf), "\\U%04" PRIX32, c);
94
+ snprintf(buf, sizeof(buf), "\\U%04" PRIX32, c);
95
95
  } else if ((flags & ASN1_STRFLGS_ESC_MSB) && c > 0x7f) {
96
- BIO_snprintf(buf, sizeof(buf), "\\%02X", c);
96
+ snprintf(buf, sizeof(buf), "\\%02X", c);
97
97
  } else if ((flags & ASN1_STRFLGS_ESC_CTRL) && is_control_character(c)) {
98
- BIO_snprintf(buf, sizeof(buf), "\\%02X", c);
98
+ snprintf(buf, sizeof(buf), "\\%02X", c);
99
99
  } else if (flags & ASN1_STRFLGS_ESC_2253) {
100
100
  // See RFC 2253, sections 2.4 and 4.
101
101
  if (c == '\\' || c == '"') {
102
102
  // Quotes and backslashes are always escaped, quoted or not.
103
- BIO_snprintf(buf, sizeof(buf), "\\%c", (int)c);
103
+ snprintf(buf, sizeof(buf), "\\%c", (int)c);
104
104
  } else if (c == ',' || c == '+' || c == '<' || c == '>' || c == ';' ||
105
105
  (is_first && (c == ' ' || c == '#')) ||
106
106
  (is_last && (c == ' '))) {
@@ -111,13 +111,13 @@ static int do_esc_char(uint32_t c, unsigned long flags, char *do_quotes,
111
111
  }
112
112
  return maybe_write(out, &u8, 1) ? 1 : -1;
113
113
  }
114
- BIO_snprintf(buf, sizeof(buf), "\\%c", (int)c);
114
+ snprintf(buf, sizeof(buf), "\\%c", (int)c);
115
115
  } else {
116
116
  return maybe_write(out, &u8, 1) ? 1 : -1;
117
117
  }
118
118
  } else if ((flags & ESC_FLAGS) && c == '\\') {
119
119
  // If any escape flags are set, also escape backslashes.
120
- BIO_snprintf(buf, sizeof(buf), "\\%c", (int)c);
120
+ snprintf(buf, sizeof(buf), "\\%c", (int)c);
121
121
  } else {
122
122
  return maybe_write(out, &u8, 1) ? 1 : -1;
123
123
  }
@@ -60,6 +60,7 @@
60
60
  #include <openssl/mem.h>
61
61
  #include <openssl/time.h>
62
62
 
63
+ #include <stdlib.h>
63
64
  #include <string.h>
64
65
  #include <time.h>
65
66
 
@@ -124,9 +125,12 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, int64_t posix_time, int offset_d
124
125
  }
125
126
 
126
127
  char buf[14];
127
- BIO_snprintf(buf, sizeof(buf), "%02d%02d%02d%02d%02d%02dZ",
128
- data.tm_year % 100, data.tm_mon + 1, data.tm_mday, data.tm_hour,
129
- data.tm_min, data.tm_sec);
128
+ int ret = snprintf(buf, sizeof(buf), "%02d%02d%02d%02d%02d%02dZ",
129
+ data.tm_year % 100, data.tm_mon + 1, data.tm_mday,
130
+ data.tm_hour, data.tm_min, data.tm_sec);
131
+ if (ret != (int)(sizeof(buf) - 1)) {
132
+ abort(); // |snprintf| should neither truncate nor write fewer bytes.
133
+ }
130
134
 
131
135
  int free_s = 0;
132
136
  if (s == NULL) {