Merge pull request #14184 from vjpai/gpr_review

GPR review: Privatize useful.h and avl.h
pull/14374/head
Vijay Pai 7 years ago committed by GitHub
commit 063d5de052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      BUILD
  2. 72
      CMakeLists.txt
  3. 91
      Makefile
  4. 25
      build.yaml
  5. 3
      config.m4
  6. 3
      config.w32
  7. 5
      gRPC-C++.podspec
  8. 8
      gRPC-Core.podspec
  9. 8
      grpc.def
  10. 6
      grpc.gemspec
  11. 5
      grpc.gyp
  12. 1
      include/grpc++/server_builder.h
  13. 2
      include/grpc/module.modulemap
  14. 6
      package.xml
  15. 1
      src/core/ext/filters/client_channel/client_channel.cc
  16. 1
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
  17. 1
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
  18. 1
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  19. 19
      src/core/ext/filters/client_channel/retry_throttle.cc
  20. 1
      src/core/ext/filters/client_channel/subchannel.cc
  21. 56
      src/core/ext/filters/client_channel/subchannel_index.cc
  22. 3
      src/core/ext/transport/chttp2/alpn/alpn.cc
  23. 1
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  24. 1
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  25. 1
      src/core/ext/transport/chttp2/transport/flow_control.cc
  26. 2
      src/core/ext/transport/chttp2/transport/flow_control.h
  27. 1
      src/core/ext/transport/chttp2/transport/frame_data.cc
  28. 1
      src/core/ext/transport/chttp2/transport/frame_settings.cc
  29. 1
      src/core/ext/transport/chttp2/transport/hpack_encoder.cc
  30. 1
      src/core/ext/transport/chttp2/transport/hpack_parser.cc
  31. 2
      src/core/ext/transport/chttp2/transport/http2_settings.cc
  32. 1
      src/core/ext/transport/chttp2/transport/stream_map.cc
  33. 1
      src/core/ext/transport/cronet/transport/cronet_transport.cc
  34. 118
      src/core/lib/avl/avl.cc
  35. 60
      src/core/lib/avl/avl.h
  36. 2
      src/core/lib/backoff/backoff.cc
  37. 2
      src/core/lib/channel/channel_args.cc
  38. 2
      src/core/lib/compression/compression.cc
  39. 2
      src/core/lib/compression/compression_internal.cc
  40. 2
      src/core/lib/debug/stats.cc
  41. 3
      src/core/lib/debug/stats_data.cc
  42. 1
      src/core/lib/gpr/arena.cc
  43. 3
      src/core/lib/gpr/atm.cc
  44. 3
      src/core/lib/gpr/cpu_posix.cc
  45. 2
      src/core/lib/gpr/env_linux.cc
  46. 8
      src/core/lib/gpr/env_windows.cc
  47. 2
      src/core/lib/gpr/fork.cc
  48. 3
      src/core/lib/gpr/string.cc
  49. 2
      src/core/lib/gpr/thd_posix.cc
  50. 6
      src/core/lib/gpr/useful.h
  51. 1
      src/core/lib/http/format_request.cc
  52. 1
      src/core/lib/http/httpcli.cc
  53. 3
      src/core/lib/http/parser.cc
  54. 2
      src/core/lib/iomgr/error.cc
  55. 2
      src/core/lib/iomgr/ev_epoll1_linux.cc
  56. 2
      src/core/lib/iomgr/ev_epollex_linux.cc
  57. 2
      src/core/lib/iomgr/ev_epollsig_linux.cc
  58. 2
      src/core/lib/iomgr/ev_poll_posix.cc
  59. 2
      src/core/lib/iomgr/ev_posix.cc
  60. 2
      src/core/lib/iomgr/executor.cc
  61. 1
      src/core/lib/iomgr/fork_posix.cc
  62. 1
      src/core/lib/iomgr/iocp_windows.cc
  63. 2
      src/core/lib/iomgr/iomgr.cc
  64. 2
      src/core/lib/iomgr/resolve_address_posix.cc
  65. 2
      src/core/lib/iomgr/resolve_address_uv.cc
  66. 2
      src/core/lib/iomgr/resource_quota.cc
  67. 2
      src/core/lib/iomgr/socket_factory_posix.cc
  68. 6
      src/core/lib/iomgr/socket_mutator.cc
  69. 1
      src/core/lib/iomgr/tcp_client_windows.cc
  70. 2
      src/core/lib/iomgr/tcp_posix.cc
  71. 1
      src/core/lib/iomgr/tcp_server_posix.cc
  72. 2
      src/core/lib/iomgr/tcp_windows.cc
  73. 2
      src/core/lib/iomgr/timer_generic.cc
  74. 3
      src/core/lib/iomgr/timer_heap.cc
  75. 3
      src/core/lib/iomgr/unix_sockets_posix.cc
  76. 3
      src/core/lib/iomgr/wakeup_fd_cv.cc
  77. 1
      src/core/lib/security/credentials/jwt/jwt_verifier.cc
  78. 2
      src/core/lib/slice/b64.cc
  79. 2
      src/core/lib/slice/slice_buffer.cc
  80. 2
      src/core/lib/surface/call.cc
  81. 1
      src/core/lib/surface/channel_init.cc
  82. 1
      src/core/lib/surface/server.cc
  83. 2
      src/core/lib/transport/bdp_estimator.cc
  84. 2
      src/core/lib/transport/metadata.h
  85. 3
      src/core/lib/transport/pid_controller.cc
  86. 1
      src/core/lib/transport/transport_op_string.cc
  87. 3
      src/core/tsi/fake_transport_security.cc
  88. 1
      src/core/tsi/ssl_transport_security.cc
  89. 1
      src/cpp/client/channel_cc.cc
  90. 2
      src/cpp/server/server_builder.cc
  91. 2
      src/python/grpcio/grpc_core_dependencies.py
  92. 16
      src/ruby/ext/grpc/rb_grpc_imports.generated.c
  93. 25
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  94. 30
      test/core/avl/BUILD
  95. 3659
      test/core/avl/avl_test.cc
  96. 1
      test/core/backoff/backoff_test.cc
  97. 2
      test/core/bad_ssl/servers/alpn.cc
  98. 1
      test/core/bad_ssl/servers/cert.cc
  99. 2
      test/core/channel/channel_args_test.cc
  100. 1
      test/core/compression/algorithm_test.cc
  101. Some files were not shown because too many files have changed in this diff Show More

32
BUILD

@ -66,7 +66,6 @@ GPR_PUBLIC_HDRS = [
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_windows.h",
"include/grpc/support/avl.h",
"include/grpc/support/cpu.h",
"include/grpc/support/log.h",
"include/grpc/support/log_windows.h",
@ -79,7 +78,6 @@ GPR_PUBLIC_HDRS = [
"include/grpc/support/sync_windows.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/useful.h",
]
GRPC_PUBLIC_HDRS = [
@ -445,12 +443,9 @@ grpc_cc_library(
grpc_cc_library(
name = "gpr_base",
srcs = [
"src/core/lib/profiling/basic_timers.cc",
"src/core/lib/profiling/stap_timers.cc",
"src/core/lib/gpr/alloc.cc",
"src/core/lib/gpr/arena.cc",
"src/core/lib/gpr/atm.cc",
"src/core/lib/gpr/avl.cc",
"src/core/lib/gpr/cpu_iphone.cc",
"src/core/lib/gpr/cpu_linux.cc",
"src/core/lib/gpr/cpu_posix.cc",
@ -486,9 +481,10 @@ grpc_cc_library(
"src/core/lib/gpr/tmpfile_posix.cc",
"src/core/lib/gpr/tmpfile_windows.cc",
"src/core/lib/gpr/wrap_memcpy.cc",
"src/core/lib/profiling/basic_timers.cc",
"src/core/lib/profiling/stap_timers.cc",
],
hdrs = [
"src/core/lib/profiling/timers.h",
"src/core/lib/gpr/arena.h",
"src/core/lib/gpr/env.h",
"src/core/lib/gpr/fork.h",
@ -505,6 +501,8 @@ grpc_cc_library(
"src/core/lib/gpr/tls_msvc.h",
"src/core/lib/gpr/tls_pthread.h",
"src/core/lib/gpr/tmpfile.h",
"src/core/lib/gpr/useful.h",
"src/core/lib/profiling/timers.h",
],
language = "c++",
public_hdrs = GPR_PUBLIC_HDRS,
@ -557,14 +555,14 @@ grpc_cc_library(
grpc_cc_library(
name = "atomic",
language = "c++",
public_hdrs = [
"src/core/lib/gprpp/atomic.h",
],
hdrs = [
"src/core/lib/gprpp/atomic_with_atm.h",
"src/core/lib/gprpp/atomic_with_std.h",
],
language = "c++",
public_hdrs = [
"src/core/lib/gprpp/atomic.h",
],
deps = [
"gpr",
],
@ -593,9 +591,9 @@ grpc_cc_library(
public_hdrs = ["src/core/lib/gprpp/orphanable.h"],
deps = [
"debug_location",
"ref_counted_ptr",
"gpr++_base",
"grpc_trace",
"ref_counted_ptr",
],
)
@ -605,9 +603,9 @@ grpc_cc_library(
public_hdrs = ["src/core/lib/gprpp/ref_counted.h"],
deps = [
"debug_location",
"ref_counted_ptr",
"gpr++_base",
"grpc_trace",
"ref_counted_ptr",
],
)
@ -623,6 +621,7 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_base_c",
srcs = [
"src/core/lib/avl/avl.cc",
"src/core/lib/backoff/backoff.cc",
"src/core/lib/channel/channel_args.cc",
"src/core/lib/channel/channel_stack.cc",
@ -757,6 +756,7 @@ grpc_cc_library(
"src/core/lib/transport/transport_op_string.cc",
],
hdrs = [
"src/core/lib/avl/avl.h",
"src/core/lib/backoff/backoff.h",
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
@ -883,8 +883,8 @@ grpc_cc_library(
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS,
deps = [
"gpr_base",
"gpr++_base",
"gpr_base",
"grpc_codegen",
"grpc_trace",
],
@ -974,13 +974,13 @@ grpc_cc_library(
],
language = "c++",
deps = [
"gpr_base",
"grpc_base",
"grpc_deadline_filter",
"inlined_vector",
"orphanable",
"ref_counted",
"ref_counted_ptr",
"gpr_base",
"grpc_base",
"grpc_deadline_filter",
],
)

@ -213,6 +213,7 @@ add_dependencies(buildtests_c algorithm_test)
add_dependencies(buildtests_c alloc_test)
add_dependencies(buildtests_c alpn_test)
add_dependencies(buildtests_c arena_test)
add_dependencies(buildtests_c avl_test)
add_dependencies(buildtests_c bad_server_response_test)
add_dependencies(buildtests_c bin_decoder_test)
add_dependencies(buildtests_c bin_encoder_test)
@ -258,7 +259,6 @@ endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c goaway_server_test)
endif()
add_dependencies(buildtests_c gpr_avl_test)
add_dependencies(buildtests_c gpr_cpu_test)
add_dependencies(buildtests_c gpr_env_test)
add_dependencies(buildtests_c gpr_host_port_test)
@ -628,7 +628,6 @@ add_library(gpr
src/core/lib/gpr/alloc.cc
src/core/lib/gpr/arena.cc
src/core/lib/gpr/atm.cc
src/core/lib/gpr/avl.cc
src/core/lib/gpr/cpu_iphone.cc
src/core/lib/gpr/cpu_linux.cc
src/core/lib/gpr/cpu_posix.cc
@ -701,7 +700,6 @@ foreach(_hdr
include/grpc/support/atm_gcc_atomic.h
include/grpc/support/atm_gcc_sync.h
include/grpc/support/atm_windows.h
include/grpc/support/avl.h
include/grpc/support/cpu.h
include/grpc/support/log.h
include/grpc/support/log_windows.h
@ -714,7 +712,6 @@ foreach(_hdr
include/grpc/support/sync_windows.h
include/grpc/support/thd.h
include/grpc/support/time.h
include/grpc/support/useful.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -784,6 +781,7 @@ endif (gRPC_BUILD_TESTS)
add_library(grpc
src/core/lib/surface/init.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
@ -1123,6 +1121,7 @@ endif()
add_library(grpc_cronet
src/core/lib/surface/init.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
@ -1448,6 +1447,7 @@ add_library(grpc_test_util
test/core/util/tracer_util.cc
test/core/util/trickle_endpoint.cc
test/core/util/cmdline.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
@ -1668,7 +1668,6 @@ foreach(_hdr
include/grpc/support/atm_gcc_atomic.h
include/grpc/support/atm_gcc_sync.h
include/grpc/support/atm_windows.h
include/grpc/support/avl.h
include/grpc/support/cpu.h
include/grpc/support/log.h
include/grpc/support/log_windows.h
@ -1681,7 +1680,6 @@ foreach(_hdr
include/grpc/support/sync_windows.h
include/grpc/support/thd.h
include/grpc/support/time.h
include/grpc/support/useful.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -1736,6 +1734,7 @@ add_library(grpc_test_util_unsecure
test/core/util/tracer_util.cc
test/core/util/trickle_endpoint.cc
test/core/util/cmdline.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
@ -1956,7 +1955,6 @@ foreach(_hdr
include/grpc/support/atm_gcc_atomic.h
include/grpc/support/atm_gcc_sync.h
include/grpc/support/atm_windows.h
include/grpc/support/avl.h
include/grpc/support/cpu.h
include/grpc/support/log.h
include/grpc/support/log_windows.h
@ -1969,7 +1967,6 @@ foreach(_hdr
include/grpc/support/sync_windows.h
include/grpc/support/thd.h
include/grpc/support/time.h
include/grpc/support/useful.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -2004,6 +2001,7 @@ endif (gRPC_BUILD_TESTS)
add_library(grpc_unsecure
src/core/lib/surface/init.cc
src/core/lib/surface/init_unsecure.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
@ -2516,7 +2514,6 @@ foreach(_hdr
include/grpc/support/atm_gcc_atomic.h
include/grpc/support/atm_gcc_sync.h
include/grpc/support/atm_windows.h
include/grpc/support/avl.h
include/grpc/support/cpu.h
include/grpc/support/log.h
include/grpc/support/log_windows.h
@ -2529,7 +2526,6 @@ foreach(_hdr
include/grpc/support/sync_windows.h
include/grpc/support/thd.h
include/grpc/support/time.h
include/grpc/support/useful.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -2727,6 +2723,7 @@ add_library(grpc++_cronet
src/core/ext/transport/chttp2/transport/stream_map.cc
src/core/ext/transport/chttp2/transport/varint.cc
src/core/ext/transport/chttp2/transport/writing.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
src/core/lib/channel/channel_stack.cc
@ -2981,7 +2978,6 @@ foreach(_hdr
include/grpc/support/atm_gcc_atomic.h
include/grpc/support/atm_gcc_sync.h
include/grpc/support/atm_windows.h
include/grpc/support/avl.h
include/grpc/support/cpu.h
include/grpc/support/log.h
include/grpc/support/log_windows.h
@ -2994,7 +2990,6 @@ foreach(_hdr
include/grpc/support/sync_windows.h
include/grpc/support/thd.h
include/grpc/support/time.h
include/grpc/support/useful.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -3704,7 +3699,6 @@ foreach(_hdr
include/grpc/support/atm_gcc_atomic.h
include/grpc/support/atm_gcc_sync.h
include/grpc/support/atm_windows.h
include/grpc/support/avl.h
include/grpc/support/cpu.h
include/grpc/support/log.h
include/grpc/support/log_windows.h
@ -3717,7 +3711,6 @@ foreach(_hdr
include/grpc/support/sync_windows.h
include/grpc/support/thd.h
include/grpc/support/time.h
include/grpc/support/useful.h
include/grpc/impl/codegen/atm.h
include/grpc/impl/codegen/atm_gcc_atomic.h
include/grpc/impl/codegen/atm_gcc_sync.h
@ -4836,6 +4829,32 @@ target_link_libraries(arena_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(avl_test
test/core/avl/avl_test.cc
)
target_include_directories(avl_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
)
target_link_libraries(avl_test
${_gRPC_ALLTARGETS_LIBRARIES}
gpr_test_util
gpr
grpc
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(bad_server_response_test
test/core/end2end/bad_server_response_test.cc
)
@ -5663,31 +5682,6 @@ endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(gpr_avl_test
test/core/gpr/avl_test.cc
)
target_include_directories(gpr_avl_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${_gRPC_SSL_INCLUDE_DIR}
PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR}
PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR}
PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR}
PRIVATE ${_gRPC_CARES_INCLUDE_DIR}
PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR}
)
target_link_libraries(gpr_avl_test
${_gRPC_ALLTARGETS_LIBRARIES}
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(gpr_cpu_test
test/core/gpr/cpu_test.cc
)

@ -955,6 +955,7 @@ alloc_test: $(BINDIR)/$(CONFIG)/alloc_test
alpn_test: $(BINDIR)/$(CONFIG)/alpn_test
api_fuzzer: $(BINDIR)/$(CONFIG)/api_fuzzer
arena_test: $(BINDIR)/$(CONFIG)/arena_test
avl_test: $(BINDIR)/$(CONFIG)/avl_test
bad_server_response_test: $(BINDIR)/$(CONFIG)/bad_server_response_test
bin_decoder_test: $(BINDIR)/$(CONFIG)/bin_decoder_test
bin_encoder_test: $(BINDIR)/$(CONFIG)/bin_encoder_test
@ -986,7 +987,6 @@ fling_server: $(BINDIR)/$(CONFIG)/fling_server
fling_stream_test: $(BINDIR)/$(CONFIG)/fling_stream_test
fling_test: $(BINDIR)/$(CONFIG)/fling_test
goaway_server_test: $(BINDIR)/$(CONFIG)/goaway_server_test
gpr_avl_test: $(BINDIR)/$(CONFIG)/gpr_avl_test
gpr_cpu_test: $(BINDIR)/$(CONFIG)/gpr_cpu_test
gpr_env_test: $(BINDIR)/$(CONFIG)/gpr_env_test
gpr_host_port_test: $(BINDIR)/$(CONFIG)/gpr_host_port_test
@ -1372,6 +1372,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/alloc_test \
$(BINDIR)/$(CONFIG)/alpn_test \
$(BINDIR)/$(CONFIG)/arena_test \
$(BINDIR)/$(CONFIG)/avl_test \
$(BINDIR)/$(CONFIG)/bad_server_response_test \
$(BINDIR)/$(CONFIG)/bin_decoder_test \
$(BINDIR)/$(CONFIG)/bin_encoder_test \
@ -1401,7 +1402,6 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/fling_stream_test \
$(BINDIR)/$(CONFIG)/fling_test \
$(BINDIR)/$(CONFIG)/goaway_server_test \
$(BINDIR)/$(CONFIG)/gpr_avl_test \
$(BINDIR)/$(CONFIG)/gpr_cpu_test \
$(BINDIR)/$(CONFIG)/gpr_env_test \
$(BINDIR)/$(CONFIG)/gpr_host_port_test \
@ -1812,6 +1812,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/alpn_test || ( echo test alpn_test failed ; exit 1 )
$(E) "[RUN] Testing arena_test"
$(Q) $(BINDIR)/$(CONFIG)/arena_test || ( echo test arena_test failed ; exit 1 )
$(E) "[RUN] Testing avl_test"
$(Q) $(BINDIR)/$(CONFIG)/avl_test || ( echo test avl_test failed ; exit 1 )
$(E) "[RUN] Testing bad_server_response_test"
$(Q) $(BINDIR)/$(CONFIG)/bad_server_response_test || ( echo test bad_server_response_test failed ; exit 1 )
$(E) "[RUN] Testing bin_decoder_test"
@ -1866,8 +1868,6 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/fling_test || ( echo test fling_test failed ; exit 1 )
$(E) "[RUN] Testing goaway_server_test"
$(Q) $(BINDIR)/$(CONFIG)/goaway_server_test || ( echo test goaway_server_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_avl_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_avl_test || ( echo test gpr_avl_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_cpu_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_cpu_test || ( echo test gpr_cpu_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_env_test"
@ -2876,7 +2876,6 @@ LIBGPR_SRC = \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/arena.cc \
src/core/lib/gpr/atm.cc \
src/core/lib/gpr/avl.cc \
src/core/lib/gpr/cpu_iphone.cc \
src/core/lib/gpr/cpu_linux.cc \
src/core/lib/gpr/cpu_posix.cc \
@ -2921,7 +2920,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
@ -2934,7 +2932,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/useful.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -3013,6 +3010,7 @@ endif
LIBGRPC_SRC = \
src/core/lib/surface/init.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -3354,6 +3352,7 @@ endif
LIBGRPC_CRONET_SRC = \
src/core/lib/surface/init.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -3680,6 +3679,7 @@ LIBGRPC_TEST_UTIL_SRC = \
test/core/util/tracer_util.cc \
test/core/util/trickle_endpoint.cc \
test/core/util/cmdline.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -3869,7 +3869,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
@ -3882,7 +3881,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/useful.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -3961,6 +3959,7 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
test/core/util/tracer_util.cc \
test/core/util/trickle_endpoint.cc \
test/core/util/cmdline.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -4150,7 +4149,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
@ -4163,7 +4161,6 @@ PUBLIC_HEADERS_C += \
include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/useful.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -4209,6 +4206,7 @@ endif
LIBGRPC_UNSECURE_SRC = \
src/core/lib/surface/init.cc \
src/core/lib/surface/init_unsecure.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -4674,7 +4672,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
@ -4687,7 +4684,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/useful.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -4933,6 +4929,7 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/stream_map.cc \
src/core/ext/transport/chttp2/transport/varint.cc \
src/core/ext/transport/chttp2/transport/writing.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -5152,7 +5149,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
@ -5165,7 +5161,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/useful.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -5864,7 +5859,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cpu.h \
include/grpc/support/log.h \
include/grpc/support/log_windows.h \
@ -5877,7 +5871,6 @@ PUBLIC_HEADERS_CXX += \
include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/useful.h \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
@ -9410,6 +9403,38 @@ endif
endif
AVL_TEST_SRC = \
test/core/avl/avl_test.cc \
AVL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(AVL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/avl_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/avl_test: $(AVL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(AVL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/avl_test
endif
$(OBJDIR)/$(CONFIG)/test/core/avl/avl_test.o: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a
deps_avl_test: $(AVL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(AVL_TEST_OBJS:.o=.dep)
endif
endif
BAD_SERVER_RESPONSE_TEST_SRC = \
test/core/end2end/bad_server_response_test.cc \
@ -10405,38 +10430,6 @@ endif
endif
GPR_AVL_TEST_SRC = \
test/core/gpr/avl_test.cc \
GPR_AVL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_AVL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/gpr_avl_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/gpr_avl_test: $(GPR_AVL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(GPR_AVL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gpr_avl_test
endif
$(OBJDIR)/$(CONFIG)/test/core/gpr/avl_test.o: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_gpr_avl_test: $(GPR_AVL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(GPR_AVL_TEST_OBJS:.o=.dep)
endif
endif
GPR_CPU_TEST_SRC = \
test/core/gpr/cpu_test.cc \

@ -36,7 +36,6 @@ filegroups:
- src/core/lib/gpr/alloc.cc
- src/core/lib/gpr/arena.cc
- src/core/lib/gpr/atm.cc
- src/core/lib/gpr/avl.cc
- src/core/lib/gpr/cpu_iphone.cc
- src/core/lib/gpr/cpu_linux.cc
- src/core/lib/gpr/cpu_posix.cc
@ -83,7 +82,6 @@ filegroups:
- include/grpc/support/atm_gcc_atomic.h
- include/grpc/support/atm_gcc_sync.h
- include/grpc/support/atm_windows.h
- include/grpc/support/avl.h
- include/grpc/support/cpu.h
- include/grpc/support/log.h
- include/grpc/support/log_windows.h
@ -96,7 +94,6 @@ filegroups:
- include/grpc/support/sync_windows.h
- include/grpc/support/thd.h
- include/grpc/support/time.h
- include/grpc/support/useful.h
headers:
- src/core/lib/gpr/arena.h
- src/core/lib/gpr/env.h
@ -114,6 +111,7 @@ filegroups:
- src/core/lib/gpr/tls_msvc.h
- src/core/lib/gpr/tls_pthread.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- src/core/lib/gprpp/abstract.h
- src/core/lib/gprpp/atomic.h
- src/core/lib/gprpp/atomic_with_atm.h
@ -152,6 +150,7 @@ filegroups:
- grpc++_codegen_base
- name: grpc_base
src:
- src/core/lib/avl/avl.cc
- src/core/lib/backoff/backoff.cc
- src/core/lib/channel/channel_args.cc
- src/core/lib/channel/channel_stack.cc
@ -307,6 +306,7 @@ filegroups:
- include/grpc/status.h
- include/grpc/support/workaround_list.h
headers:
- src/core/lib/avl/avl.h
- src/core/lib/backoff/backoff.h
- src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h
@ -1765,6 +1765,16 @@ targets:
- gpr_test_util
- gpr
uses_polling: false
- name: avl_test
build: test
language: c
src:
- test/core/avl/avl_test.cc
deps:
- gpr_test_util
- gpr
- grpc
uses_polling: false
- name: bad_server_response_test
build: test
language: c
@ -2143,15 +2153,6 @@ targets:
- mac
- linux
- posix
- name: gpr_avl_test
build: test
language: c
src:
- test/core/gpr/avl_test.cc
deps:
- gpr_test_util
- gpr
uses_polling: false
- name: gpr_cpu_test
cpu_cost: 30
build: test

@ -42,7 +42,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/arena.cc \
src/core/lib/gpr/atm.cc \
src/core/lib/gpr/avl.cc \
src/core/lib/gpr/cpu_iphone.cc \
src/core/lib/gpr/cpu_linux.cc \
src/core/lib/gpr/cpu_posix.cc \
@ -81,6 +80,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/profiling/basic_timers.cc \
src/core/lib/profiling/stap_timers.cc \
src/core/lib/surface/init.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
@ -621,6 +621,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/inproc)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/compression)

@ -19,7 +19,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gpr\\alloc.cc " +
"src\\core\\lib\\gpr\\arena.cc " +
"src\\core\\lib\\gpr\\atm.cc " +
"src\\core\\lib\\gpr\\avl.cc " +
"src\\core\\lib\\gpr\\cpu_iphone.cc " +
"src\\core\\lib\\gpr\\cpu_linux.cc " +
"src\\core\\lib\\gpr\\cpu_posix.cc " +
@ -58,6 +57,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\profiling\\basic_timers.cc " +
"src\\core\\lib\\profiling\\stap_timers.cc " +
"src\\core\\lib\\surface\\init.cc " +
"src\\core\\lib\\avl\\avl.cc " +
"src\\core\\lib\\backoff\\backoff.cc " +
"src\\core\\lib\\channel\\channel_args.cc " +
"src\\core\\lib\\channel\\channel_stack.cc " +
@ -633,6 +633,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\inproc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\backoff");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\channel");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\compression");

@ -219,6 +219,7 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_msvc.h',
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/atomic_with_atm.h',
@ -300,6 +301,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
@ -469,6 +471,7 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_msvc.h',
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/atomic_with_atm.h',
@ -476,6 +479,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/manual_constructor.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/profiling/timers.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
@ -657,6 +661,7 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_msvc.h',
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/atomic_with_atm.h',

@ -114,7 +114,6 @@ Pod::Spec.new do |s|
'include/grpc/support/atm_gcc_atomic.h',
'include/grpc/support/atm_gcc_sync.h',
'include/grpc/support/atm_windows.h',
'include/grpc/support/avl.h',
'include/grpc/support/cpu.h',
'include/grpc/support/log.h',
'include/grpc/support/log_windows.h',
@ -127,7 +126,6 @@ Pod::Spec.new do |s|
'include/grpc/support/sync_windows.h',
'include/grpc/support/thd.h',
'include/grpc/support/time.h',
'include/grpc/support/useful.h',
'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h',
@ -201,6 +199,7 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_msvc.h',
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/atomic_with_atm.h',
@ -211,7 +210,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/arena.cc',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/avl.cc',
'src/core/lib/gpr/cpu_iphone.cc',
'src/core/lib/gpr/cpu_linux.cc',
'src/core/lib/gpr/cpu_posix.cc',
@ -323,6 +321,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
@ -465,6 +464,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
'src/core/ext/filters/workarounds/workaround_utils.h',
'src/core/lib/surface/init.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
@ -728,6 +728,7 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls_msvc.h',
'src/core/lib/gpr/tls_pthread.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/abstract.h',
'src/core/lib/gprpp/atomic.h',
'src/core/lib/gprpp/atomic_with_atm.h',
@ -809,6 +810,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',

@ -176,14 +176,6 @@ EXPORTS
gpr_free_aligned
gpr_set_allocation_functions
gpr_get_allocation_functions
gpr_avl_create
gpr_avl_ref
gpr_avl_unref
gpr_avl_add
gpr_avl_remove
gpr_avl_get
gpr_avl_maybe_get
gpr_avl_is_empty
gpr_cpu_num_cores
gpr_cpu_current_cpu
gpr_log_severity_string

@ -49,7 +49,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/atm_gcc_atomic.h )
s.files += %w( include/grpc/support/atm_gcc_sync.h )
s.files += %w( include/grpc/support/atm_windows.h )
s.files += %w( include/grpc/support/avl.h )
s.files += %w( include/grpc/support/cpu.h )
s.files += %w( include/grpc/support/log.h )
s.files += %w( include/grpc/support/log_windows.h )
@ -62,7 +61,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/sync_windows.h )
s.files += %w( include/grpc/support/thd.h )
s.files += %w( include/grpc/support/time.h )
s.files += %w( include/grpc/support/useful.h )
s.files += %w( include/grpc/impl/codegen/atm.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
@ -92,6 +90,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/tls_msvc.h )
s.files += %w( src/core/lib/gpr/tls_pthread.h )
s.files += %w( src/core/lib/gpr/tmpfile.h )
s.files += %w( src/core/lib/gpr/useful.h )
s.files += %w( src/core/lib/gprpp/abstract.h )
s.files += %w( src/core/lib/gprpp/atomic.h )
s.files += %w( src/core/lib/gprpp/atomic_with_atm.h )
@ -102,7 +101,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/alloc.cc )
s.files += %w( src/core/lib/gpr/arena.cc )
s.files += %w( src/core/lib/gpr/atm.cc )
s.files += %w( src/core/lib/gpr/avl.cc )
s.files += %w( src/core/lib/gpr/cpu_iphone.cc )
s.files += %w( src/core/lib/gpr/cpu_linux.cc )
s.files += %w( src/core/lib/gpr/cpu_posix.cc )
@ -249,6 +247,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h )
s.files += %w( src/core/ext/transport/inproc/inproc_transport.h )
s.files += %w( src/core/lib/avl/avl.h )
s.files += %w( src/core/lib/backoff/backoff.h )
s.files += %w( src/core/lib/channel/channel_args.h )
s.files += %w( src/core/lib/channel/channel_stack.h )
@ -395,6 +394,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h )
s.files += %w( src/core/ext/filters/workarounds/workaround_utils.h )
s.files += %w( src/core/lib/surface/init.cc )
s.files += %w( src/core/lib/avl/avl.cc )
s.files += %w( src/core/lib/backoff/backoff.cc )
s.files += %w( src/core/lib/channel/channel_args.cc )
s.files += %w( src/core/lib/channel/channel_stack.cc )

@ -164,7 +164,6 @@
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/arena.cc',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/avl.cc',
'src/core/lib/gpr/cpu_iphone.cc',
'src/core/lib/gpr/cpu_linux.cc',
'src/core/lib/gpr/cpu_posix.cc',
@ -222,6 +221,7 @@
],
'sources': [
'src/core/lib/surface/init.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
@ -518,6 +518,7 @@
'test/core/util/tracer_util.cc',
'test/core/util/trickle_endpoint.cc',
'test/core/util/cmdline.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
@ -732,6 +733,7 @@
'test/core/util/tracer_util.cc',
'test/core/util/trickle_endpoint.cc',
'test/core/util/cmdline.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',
@ -925,6 +927,7 @@
'sources': [
'src/core/lib/surface/init.cc',
'src/core/lib/surface/init_unsecure.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',

@ -30,7 +30,6 @@
#include <grpc++/support/config.h>
#include <grpc/compression.h>
#include <grpc/support/cpu.h>
#include <grpc/support/useful.h>
#include <grpc/support/workaround_list.h>
struct grpc_resource_quota;

@ -4,7 +4,6 @@ framework module grpc {
header "support/alloc.h"
header "support/atm.h"
header "support/avl.h"
header "support/cpu.h"
header "support/log.h"
header "support/log_windows.h"
@ -14,7 +13,6 @@ framework module grpc {
header "support/sync_generic.h"
header "support/thd.h"
header "support/time.h"
header "support/useful.h"
header "impl/codegen/atm.h"
header "impl/codegen/fork.h"
header "impl/codegen/gpr_slice.h"

@ -56,7 +56,6 @@
<file baseinstalldir="/" name="include/grpc/support/atm_gcc_atomic.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/atm_gcc_sync.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/atm_windows.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/avl.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/cpu.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/log.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/log_windows.h" role="src" />
@ -69,7 +68,6 @@
<file baseinstalldir="/" name="include/grpc/support/sync_windows.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/thd.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/time.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/useful.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" />
@ -99,6 +97,7 @@
<file baseinstalldir="/" name="src/core/lib/gpr/tls_msvc.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tls_pthread.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tmpfile.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/useful.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/abstract.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/atomic.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/atomic_with_atm.h" role="src" />
@ -109,7 +108,6 @@
<file baseinstalldir="/" name="src/core/lib/gpr/alloc.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/arena.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/atm.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/avl.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/cpu_iphone.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/cpu_linux.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/cpu_posix.cc" role="src" />
@ -256,6 +254,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_transport.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/avl/avl.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/backoff/backoff.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
@ -402,6 +401,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/avl/avl.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/backoff/backoff.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.cc" role="src" />

@ -29,7 +29,6 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"

@ -24,7 +24,6 @@
#include <grpc/support/atm.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"

@ -28,7 +28,6 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/ev_posix.h"

@ -31,7 +31,6 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/parse_address.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"

@ -23,10 +23,11 @@
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/avl.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include "src/core/lib/avl/avl.h"
//
// server_retry_throttle_data
//
@ -152,7 +153,7 @@ static void* copy_server_retry_throttle_data(void* value, void* unused) {
static void destroy_server_name(void* key, void* unused) { gpr_free(key); }
static const gpr_avl_vtable avl_vtable = {
static const grpc_avl_vtable avl_vtable = {
destroy_server_name, copy_server_name, compare_server_name,
destroy_server_retry_throttle_data, copy_server_retry_throttle_data};
@ -161,29 +162,29 @@ static const gpr_avl_vtable avl_vtable = {
//
static gpr_mu g_mu;
static gpr_avl g_avl;
static grpc_avl g_avl;
void grpc_retry_throttle_map_init() {
gpr_mu_init(&g_mu);
g_avl = gpr_avl_create(&avl_vtable);
g_avl = grpc_avl_create(&avl_vtable);
}
void grpc_retry_throttle_map_shutdown() {
gpr_mu_destroy(&g_mu);
gpr_avl_unref(g_avl, nullptr);
grpc_avl_unref(g_avl, nullptr);
}
grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server(
const char* server_name, int max_milli_tokens, int milli_token_ratio) {
gpr_mu_lock(&g_mu);
grpc_server_retry_throttle_data* throttle_data =
(grpc_server_retry_throttle_data*)gpr_avl_get(g_avl, (char*)server_name,
nullptr);
(grpc_server_retry_throttle_data*)grpc_avl_get(g_avl, (char*)server_name,
nullptr);
if (throttle_data == nullptr) {
// Entry not found. Create a new one.
throttle_data = grpc_server_retry_throttle_data_create(
max_milli_tokens, milli_token_ratio, nullptr);
g_avl = gpr_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
g_avl = grpc_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
} else {
if (throttle_data->max_milli_tokens != max_milli_tokens ||
throttle_data->milli_token_ratio != milli_token_ratio) {
@ -191,7 +192,7 @@ grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server(
// the original one.
throttle_data = grpc_server_retry_throttle_data_create(
max_milli_tokens, milli_token_ratio, throttle_data);
g_avl = gpr_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
g_avl = grpc_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
} else {
// Entry found. Increase refcount.
grpc_server_retry_throttle_data_ref(throttle_data);

@ -25,7 +25,6 @@
#include <cstring>
#include <grpc/support/alloc.h>
#include <grpc/support/avl.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"

@ -22,15 +22,15 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/avl.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/avl/avl.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/tls.h"
// a map of subchannel_key --> subchannel, used for detecting connections
// to the same destination in order to share them
static gpr_avl g_subchannel_index;
static grpc_avl g_subchannel_index;
static gpr_mu g_mu;
@ -109,7 +109,7 @@ static void* scv_avl_copy(void* p, void* unused) {
return p;
}
static const gpr_avl_vtable subchannel_avl_vtable = {
static const grpc_avl_vtable subchannel_avl_vtable = {
sck_avl_destroy, // destroy_key
sck_avl_copy, // copy_key
sck_avl_compare, // compare_keys
@ -118,7 +118,7 @@ static const gpr_avl_vtable subchannel_avl_vtable = {
};
void grpc_subchannel_index_init(void) {
g_subchannel_index = gpr_avl_create(&subchannel_avl_vtable);
g_subchannel_index = grpc_avl_create(&subchannel_avl_vtable);
gpr_mu_init(&g_mu);
gpr_ref_init(&g_refcount, 1);
}
@ -133,7 +133,7 @@ void grpc_subchannel_index_shutdown(void) {
void grpc_subchannel_index_unref(void) {
if (gpr_unref(&g_refcount)) {
gpr_mu_destroy(&g_mu);
gpr_avl_unref(g_subchannel_index, grpc_core::ExecCtx::Get());
grpc_avl_unref(g_subchannel_index, grpc_core::ExecCtx::Get());
}
}
@ -143,13 +143,13 @@ grpc_subchannel* grpc_subchannel_index_find(grpc_subchannel_key* key) {
// Lock, and take a reference to the subchannel index.
// We don't need to do the search under a lock as avl's are immutable.
gpr_mu_lock(&g_mu);
gpr_avl index = gpr_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
grpc_avl index = grpc_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
gpr_mu_unlock(&g_mu);
grpc_subchannel* c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(
(grpc_subchannel*)gpr_avl_get(index, key, grpc_core::ExecCtx::Get()),
(grpc_subchannel*)grpc_avl_get(index, key, grpc_core::ExecCtx::Get()),
"index_find");
gpr_avl_unref(index, grpc_core::ExecCtx::Get());
grpc_avl_unref(index, grpc_core::ExecCtx::Get());
return c;
}
@ -165,11 +165,12 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_subchannel_key* key,
// Compare and swap loop:
// - take a reference to the current index
gpr_mu_lock(&g_mu);
gpr_avl index = gpr_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
grpc_avl index =
grpc_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
gpr_mu_unlock(&g_mu);
// - Check to see if a subchannel already exists
c = (grpc_subchannel*)gpr_avl_get(index, key, grpc_core::ExecCtx::Get());
c = (grpc_subchannel*)grpc_avl_get(index, key, grpc_core::ExecCtx::Get());
if (c != nullptr) {
c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(c, "index_register");
}
@ -178,25 +179,25 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_subchannel_key* key,
need_to_unref_constructed = true;
} else {
// no -> update the avl and compare/swap
gpr_avl updated =
gpr_avl_add(gpr_avl_ref(index, grpc_core::ExecCtx::Get()),
subchannel_key_copy(key),
GRPC_SUBCHANNEL_WEAK_REF(constructed, "index_register"),
grpc_core::ExecCtx::Get());
grpc_avl updated =
grpc_avl_add(grpc_avl_ref(index, grpc_core::ExecCtx::Get()),
subchannel_key_copy(key),
GRPC_SUBCHANNEL_WEAK_REF(constructed, "index_register"),
grpc_core::ExecCtx::Get());
// it may happen (but it's expected to be unlikely)
// that some other thread has changed the index:
// compare/swap here to check that, and retry as necessary
gpr_mu_lock(&g_mu);
if (index.root == g_subchannel_index.root) {
GPR_SWAP(gpr_avl, updated, g_subchannel_index);
GPR_SWAP(grpc_avl, updated, g_subchannel_index);
c = constructed;
}
gpr_mu_unlock(&g_mu);
gpr_avl_unref(updated, grpc_core::ExecCtx::Get());
grpc_avl_unref(updated, grpc_core::ExecCtx::Get());
}
gpr_avl_unref(index, grpc_core::ExecCtx::Get());
grpc_avl_unref(index, grpc_core::ExecCtx::Get());
}
if (need_to_unref_constructed) {
@ -213,33 +214,34 @@ void grpc_subchannel_index_unregister(grpc_subchannel_key* key,
// Compare and swap loop:
// - take a reference to the current index
gpr_mu_lock(&g_mu);
gpr_avl index = gpr_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
grpc_avl index =
grpc_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
gpr_mu_unlock(&g_mu);
// Check to see if this key still refers to the previously
// registered subchannel
grpc_subchannel* c =
(grpc_subchannel*)gpr_avl_get(index, key, grpc_core::ExecCtx::Get());
(grpc_subchannel*)grpc_avl_get(index, key, grpc_core::ExecCtx::Get());
if (c != constructed) {
gpr_avl_unref(index, grpc_core::ExecCtx::Get());
grpc_avl_unref(index, grpc_core::ExecCtx::Get());
break;
}
// compare and swap the update (some other thread may have
// mutated the index behind us)
gpr_avl updated =
gpr_avl_remove(gpr_avl_ref(index, grpc_core::ExecCtx::Get()), key,
grpc_core::ExecCtx::Get());
grpc_avl updated =
grpc_avl_remove(grpc_avl_ref(index, grpc_core::ExecCtx::Get()), key,
grpc_core::ExecCtx::Get());
gpr_mu_lock(&g_mu);
if (index.root == g_subchannel_index.root) {
GPR_SWAP(gpr_avl, updated, g_subchannel_index);
GPR_SWAP(grpc_avl, updated, g_subchannel_index);
done = true;
}
gpr_mu_unlock(&g_mu);
gpr_avl_unref(updated, grpc_core::ExecCtx::Get());
gpr_avl_unref(index, grpc_core::ExecCtx::Get());
grpc_avl_unref(updated, grpc_core::ExecCtx::Get());
grpc_avl_unref(index, grpc_core::ExecCtx::Get());
}
}

@ -18,7 +18,8 @@
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
/* in order of preference */
static const char* const supported_versions[] = {"grpc-exp", "h2"};

@ -28,7 +28,6 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"

@ -30,7 +30,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/frame_data.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"

@ -26,7 +26,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/gpr/string.h"

@ -22,8 +22,8 @@
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/abstract.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/transport/bdp_estimator.h"

@ -23,7 +23,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_internal.h"

@ -24,7 +24,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/frame.h"

@ -28,7 +28,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
#include "src/core/ext/transport/chttp2/transport/hpack_table.h"

@ -27,7 +27,6 @@
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
#include "src/core/lib/debug/stats.h"

@ -20,7 +20,7 @@
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/transport/http2_errors.h"
const uint16_t grpc_setting_id_to_wire_id[] = {1, 2, 3, 4, 5, 6, 65027};

@ -22,7 +22,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map* map,
size_t initial_capacity) {

@ -23,7 +23,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
#include "src/core/ext/transport/cronet/transport/cronet_transport.h"

@ -16,30 +16,31 @@
*
*/
#include <grpc/support/avl.h>
#include "src/core/lib/avl/avl.h"
#include <assert.h>
#include <stdlib.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
gpr_avl gpr_avl_create(const gpr_avl_vtable* vtable) {
gpr_avl out;
#include "src/core/lib/gpr/useful.h"
grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable) {
grpc_avl out;
out.vtable = vtable;
out.root = nullptr;
return out;
}
static gpr_avl_node* ref_node(gpr_avl_node* node) {
static grpc_avl_node* ref_node(grpc_avl_node* node) {
if (node) {
gpr_ref(&node->refs);
}
return node;
}
static void unref_node(const gpr_avl_vtable* vtable, gpr_avl_node* node,
static void unref_node(const grpc_avl_vtable* vtable, grpc_avl_node* node,
void* user_data) {
if (node == nullptr) {
return;
@ -53,18 +54,18 @@ static void unref_node(const gpr_avl_vtable* vtable, gpr_avl_node* node,
}
}
static long node_height(gpr_avl_node* node) {
static long node_height(grpc_avl_node* node) {
return node == nullptr ? 0 : node->height;
}
#ifndef NDEBUG
static long calculate_height(gpr_avl_node* node) {
static long calculate_height(grpc_avl_node* node) {
return node == nullptr ? 0
: 1 + GPR_MAX(calculate_height(node->left),
calculate_height(node->right));
}
static gpr_avl_node* assert_invariants(gpr_avl_node* n) {
static grpc_avl_node* assert_invariants(grpc_avl_node* n) {
if (n == nullptr) return nullptr;
assert_invariants(n->left);
assert_invariants(n->right);
@ -73,12 +74,12 @@ static gpr_avl_node* assert_invariants(gpr_avl_node* n) {
return n;
}
#else
static gpr_avl_node* assert_invariants(gpr_avl_node* n) { return n; }
static grpc_avl_node* assert_invariants(grpc_avl_node* n) { return n; }
#endif
gpr_avl_node* new_node(void* key, void* value, gpr_avl_node* left,
gpr_avl_node* right) {
gpr_avl_node* node = (gpr_avl_node*)gpr_malloc(sizeof(*node));
grpc_avl_node* new_node(void* key, void* value, grpc_avl_node* left,
grpc_avl_node* right) {
grpc_avl_node* node = (grpc_avl_node*)gpr_malloc(sizeof(*node));
gpr_ref_init(&node->refs, 1);
node->key = key;
node->value = value;
@ -88,8 +89,8 @@ gpr_avl_node* new_node(void* key, void* value, gpr_avl_node* left,
return node;
}
static gpr_avl_node* get(const gpr_avl_vtable* vtable, gpr_avl_node* node,
void* key, void* user_data) {
static grpc_avl_node* get(const grpc_avl_vtable* vtable, grpc_avl_node* node,
void* key, void* user_data) {
long cmp;
if (node == nullptr) {
@ -106,13 +107,13 @@ static gpr_avl_node* get(const gpr_avl_vtable* vtable, gpr_avl_node* node,
}
}
void* gpr_avl_get(gpr_avl avl, void* key, void* user_data) {
gpr_avl_node* node = get(avl.vtable, avl.root, key, user_data);
void* grpc_avl_get(grpc_avl avl, void* key, void* user_data) {
grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
return node ? node->value : nullptr;
}
int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value, void* user_data) {
gpr_avl_node* node = get(avl.vtable, avl.root, key, user_data);
int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data) {
grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
if (node != nullptr) {
*value = node->value;
return 1;
@ -120,21 +121,21 @@ int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value, void* user_data) {
return 0;
}
static gpr_avl_node* rotate_left(const gpr_avl_vtable* vtable, void* key,
void* value, gpr_avl_node* left,
gpr_avl_node* right, void* user_data) {
gpr_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
vtable->copy_value(right->value, user_data),
new_node(key, value, left, ref_node(right->left)),
ref_node(right->right));
static grpc_avl_node* rotate_left(const grpc_avl_vtable* vtable, void* key,
void* value, grpc_avl_node* left,
grpc_avl_node* right, void* user_data) {
grpc_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
vtable->copy_value(right->value, user_data),
new_node(key, value, left, ref_node(right->left)),
ref_node(right->right));
unref_node(vtable, right, user_data);
return n;
}
static gpr_avl_node* rotate_right(const gpr_avl_vtable* vtable, void* key,
void* value, gpr_avl_node* left,
gpr_avl_node* right, void* user_data) {
gpr_avl_node* n =
static grpc_avl_node* rotate_right(const grpc_avl_vtable* vtable, void* key,
void* value, grpc_avl_node* left,
grpc_avl_node* right, void* user_data) {
grpc_avl_node* n =
new_node(vtable->copy_key(left->key, user_data),
vtable->copy_value(left->value, user_data), ref_node(left->left),
new_node(key, value, ref_node(left->right), right));
@ -142,11 +143,12 @@ static gpr_avl_node* rotate_right(const gpr_avl_vtable* vtable, void* key,
return n;
}
static gpr_avl_node* rotate_left_right(const gpr_avl_vtable* vtable, void* key,
void* value, gpr_avl_node* left,
gpr_avl_node* right, void* user_data) {
static grpc_avl_node* rotate_left_right(const grpc_avl_vtable* vtable,
void* key, void* value,
grpc_avl_node* left,
grpc_avl_node* right, void* user_data) {
/* rotate_right(..., rotate_left(left), right) */
gpr_avl_node* n =
grpc_avl_node* n =
new_node(vtable->copy_key(left->right->key, user_data),
vtable->copy_value(left->right->value, user_data),
new_node(vtable->copy_key(left->key, user_data),
@ -157,11 +159,12 @@ static gpr_avl_node* rotate_left_right(const gpr_avl_vtable* vtable, void* key,
return n;
}
static gpr_avl_node* rotate_right_left(const gpr_avl_vtable* vtable, void* key,
void* value, gpr_avl_node* left,
gpr_avl_node* right, void* user_data) {
static grpc_avl_node* rotate_right_left(const grpc_avl_vtable* vtable,
void* key, void* value,
grpc_avl_node* left,
grpc_avl_node* right, void* user_data) {
/* rotate_left(..., left, rotate_right(right)) */
gpr_avl_node* n =
grpc_avl_node* n =
new_node(vtable->copy_key(right->left->key, user_data),
vtable->copy_value(right->left->value, user_data),
new_node(key, value, left, ref_node(right->left->left)),
@ -172,9 +175,9 @@ static gpr_avl_node* rotate_right_left(const gpr_avl_vtable* vtable, void* key,
return n;
}
static gpr_avl_node* rebalance(const gpr_avl_vtable* vtable, void* key,
void* value, gpr_avl_node* left,
gpr_avl_node* right, void* user_data) {
static grpc_avl_node* rebalance(const grpc_avl_vtable* vtable, void* key,
void* value, grpc_avl_node* left,
grpc_avl_node* right, void* user_data) {
switch (node_height(left) - node_height(right)) {
case 2:
if (node_height(left->left) - node_height(left->right) == -1) {
@ -197,8 +200,9 @@ static gpr_avl_node* rebalance(const gpr_avl_vtable* vtable, void* key,
}
}
static gpr_avl_node* add_key(const gpr_avl_vtable* vtable, gpr_avl_node* node,
void* key, void* value, void* user_data) {
static grpc_avl_node* add_key(const grpc_avl_vtable* vtable,
grpc_avl_node* node, void* key, void* value,
void* user_data) {
long cmp;
if (node == nullptr) {
return new_node(key, value, nullptr, nullptr);
@ -219,31 +223,31 @@ static gpr_avl_node* add_key(const gpr_avl_vtable* vtable, gpr_avl_node* node,
}
}
gpr_avl gpr_avl_add(gpr_avl avl, void* key, void* value, void* user_data) {
gpr_avl_node* old_root = avl.root;
grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data) {
grpc_avl_node* old_root = avl.root;
avl.root = add_key(avl.vtable, avl.root, key, value, user_data);
assert_invariants(avl.root);
unref_node(avl.vtable, old_root, user_data);
return avl;
}
static gpr_avl_node* in_order_head(gpr_avl_node* node) {
static grpc_avl_node* in_order_head(grpc_avl_node* node) {
while (node->left != nullptr) {
node = node->left;
}
return node;
}
static gpr_avl_node* in_order_tail(gpr_avl_node* node) {
static grpc_avl_node* in_order_tail(grpc_avl_node* node) {
while (node->right != nullptr) {
node = node->right;
}
return node;
}
static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
gpr_avl_node* node, void* key,
void* user_data) {
static grpc_avl_node* remove_key(const grpc_avl_vtable* vtable,
grpc_avl_node* node, void* key,
void* user_data) {
long cmp;
if (node == nullptr) {
return nullptr;
@ -255,13 +259,13 @@ static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
} else if (node->right == nullptr) {
return ref_node(node->left);
} else if (node->left->height < node->right->height) {
gpr_avl_node* h = in_order_head(node->right);
grpc_avl_node* h = in_order_head(node->right);
return rebalance(
vtable, vtable->copy_key(h->key, user_data),
vtable->copy_value(h->value, user_data), ref_node(node->left),
remove_key(vtable, node->right, h->key, user_data), user_data);
} else {
gpr_avl_node* h = in_order_tail(node->left);
grpc_avl_node* h = in_order_tail(node->left);
return rebalance(vtable, vtable->copy_key(h->key, user_data),
vtable->copy_value(h->value, user_data),
remove_key(vtable, node->left, h->key, user_data),
@ -280,21 +284,21 @@ static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
}
}
gpr_avl gpr_avl_remove(gpr_avl avl, void* key, void* user_data) {
gpr_avl_node* old_root = avl.root;
grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data) {
grpc_avl_node* old_root = avl.root;
avl.root = remove_key(avl.vtable, avl.root, key, user_data);
assert_invariants(avl.root);
unref_node(avl.vtable, old_root, user_data);
return avl;
}
gpr_avl gpr_avl_ref(gpr_avl avl, void* user_data) {
grpc_avl grpc_avl_ref(grpc_avl avl, void* user_data) {
ref_node(avl.root);
return avl;
}
void gpr_avl_unref(gpr_avl avl, void* user_data) {
void grpc_avl_unref(grpc_avl avl, void* user_data) {
unref_node(avl.vtable, avl.root, user_data);
}
int gpr_avl_is_empty(gpr_avl avl) { return avl.root == nullptr; }
int grpc_avl_is_empty(grpc_avl avl) { return avl.root == nullptr; }

@ -16,31 +16,27 @@
*
*/
#ifndef GRPC_SUPPORT_AVL_H
#define GRPC_SUPPORT_AVL_H
#ifndef GRPC_CORE_LIB_AVL_AVL_H
#define GRPC_CORE_LIB_AVL_AVL_H
#include <grpc/support/sync.h>
#ifdef __cplusplus
extern "C" {
#endif
/** internal node of an AVL tree */
typedef struct gpr_avl_node {
typedef struct grpc_avl_node {
gpr_refcount refs;
void* key;
void* value;
struct gpr_avl_node* left;
struct gpr_avl_node* right;
struct grpc_avl_node* left;
struct grpc_avl_node* right;
long height;
} gpr_avl_node;
} grpc_avl_node;
/** vtable for the AVL tree
* The optional user_data is propagated from the top level gpr_avl_XXX API.
* The optional user_data is propagated from the top level grpc_avl_XXX API.
* From the same API call, multiple vtable functions may be called multiple
* times.
*/
typedef struct gpr_avl_vtable {
typedef struct grpc_avl_vtable {
/** destroy a key */
void (*destroy_key)(void* key, void* user_data);
/** copy a key, returning new value */
@ -52,51 +48,45 @@ typedef struct gpr_avl_vtable {
void (*destroy_value)(void* value, void* user_data);
/** copy a value */
void* (*copy_value)(void* value, void* user_data);
} gpr_avl_vtable;
} grpc_avl_vtable;
/** "pointer" to an AVL tree - this is a reference
counted object - use gpr_avl_ref to add a reference,
gpr_avl_unref when done with a reference */
typedef struct gpr_avl {
const gpr_avl_vtable* vtable;
gpr_avl_node* root;
} gpr_avl;
counted object - use grpc_avl_ref to add a reference,
grpc_avl_unref when done with a reference */
typedef struct grpc_avl {
const grpc_avl_vtable* vtable;
grpc_avl_node* root;
} grpc_avl;
/** Create an immutable AVL tree. */
GPRAPI gpr_avl gpr_avl_create(const gpr_avl_vtable* vtable);
grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable);
/** Add a reference to an existing tree - returns
the tree as a convenience. The optional user_data will be passed to vtable
functions. */
GPRAPI gpr_avl gpr_avl_ref(gpr_avl avl, void* user_data);
grpc_avl grpc_avl_ref(grpc_avl avl, void* user_data);
/** Remove a reference to a tree - destroying it if there
are no references left. The optional user_data will be passed to vtable
functions. */
GPRAPI void gpr_avl_unref(gpr_avl avl, void* user_data);
void grpc_avl_unref(grpc_avl avl, void* user_data);
/** Return a new tree with (key, value) added to avl.
implicitly unrefs avl to allow easy chaining.
if key exists in avl, the new tree's key entry updated
(i.e. a duplicate is not created). The optional user_data will be passed to
vtable functions. */
GPRAPI gpr_avl gpr_avl_add(gpr_avl avl, void* key, void* value,
void* user_data);
grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data);
/** Return a new tree with key deleted
implicitly unrefs avl to allow easy chaining. The optional user_data will be
passed to vtable functions. */
GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void* key, void* user_data);
grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data);
/** Lookup key, and return the associated value.
Does not mutate avl.
Returns NULL if key is not found. The optional user_data will be passed to
vtable functions.*/
GPRAPI void* gpr_avl_get(gpr_avl avl, void* key, void* user_data);
void* grpc_avl_get(grpc_avl avl, void* key, void* user_data);
/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
its value. THe optional user_data will be passed to vtable functions. */
GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value,
void* user_data);
its value. The optional user_data will be passed to vtable functions. */
int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data);
/** Return 1 if avl is empty, 0 otherwise */
GPRAPI int gpr_avl_is_empty(gpr_avl avl);
#ifdef __cplusplus
}
#endif
int grpc_avl_is_empty(grpc_avl avl);
#endif /* GRPC_SUPPORT_AVL_H */
#endif /* GRPC_CORE_LIB_AVL_AVL_H */

@ -20,7 +20,7 @@
#include <algorithm>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
namespace grpc_core {

@ -26,10 +26,10 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
static grpc_arg copy_arg(const grpc_arg* src) {
grpc_arg dst;

@ -20,10 +20,10 @@
#include <string.h>
#include <grpc/compression.h>
#include <grpc/support/useful.h>
#include "src/core/lib/compression/algorithm_metadata.h"
#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/transport/static_metadata.h"

@ -20,10 +20,10 @@
#include <string.h>
#include <grpc/compression.h>
#include <grpc/support/useful.h>
#include "src/core/lib/compression/algorithm_metadata.h"
#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/transport/static_metadata.h"

@ -23,9 +23,9 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
grpc_stats_data* grpc_stats_per_cpu_storage = nullptr;
static size_t g_num_cores;

@ -19,9 +19,10 @@
*/
#include "src/core/lib/debug/stats_data.h"
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
"client_calls_created",
"server_calls_created",

@ -23,7 +23,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
// TODO(roth): We currently assume that all callers need alignment of 16
// bytes, which may be wrong in some cases. As part of converting the

@ -17,7 +17,8 @@
*/
#include <grpc/support/atm.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
gpr_atm min, gpr_atm max) {

@ -29,7 +29,8 @@
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
static long ncpus = 0;

@ -34,9 +34,9 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
const char* gpr_getenv_silent(const char* name, char** dst) {
const char* insecure_func_used = nullptr;

@ -22,14 +22,14 @@
#include <windows.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/string_windows.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/string_windows.h"
const char* gpr_getenv_silent(const char* name, char** dst) {
*dst = gpr_getenv(name);
return NULL;

@ -21,9 +21,9 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/useful.h"
/*
* NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK

@ -28,7 +28,8 @@
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
char* gpr_strdup(const char* src) {
char* dst;

@ -26,12 +26,12 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include "src/core/lib/gpr/fork.h"
#include "src/core/lib/gpr/useful.h"
static gpr_mu g_mu;
static gpr_cv g_cv;

@ -16,8 +16,8 @@
*
*/
#ifndef GRPC_SUPPORT_USEFUL_H
#define GRPC_SUPPORT_USEFUL_H
#ifndef GRPC_CORE_LIB_GPR_USEFUL_H
#define GRPC_CORE_LIB_GPR_USEFUL_H
/** useful macros that don't belong anywhere else */
@ -62,4 +62,4 @@
#define GPR_HASH_POINTER(x, range) \
((((size_t)x) >> 4) ^ (((size_t)x) >> 9) ^ (((size_t)x) >> 14)) % (range)
#endif /* GRPC_SUPPORT_USEFUL_H */
#endif /* GRPC_CORE_LIB_GPR_USEFUL_H */

@ -25,7 +25,6 @@
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/string.h"
static void fill_common_header(const grpc_httpcli_request* request,

@ -23,7 +23,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"

@ -23,7 +23,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
grpc_core::TraceFlag grpc_http1_trace(false, "http1");

@ -26,13 +26,13 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#ifdef GPR_WINDOWS
#include <grpc/support/log_windows.h>
#endif
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/error_internal.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"

@ -39,11 +39,11 @@
#include <grpc/support/alloc.h>
#include <grpc/support/cpu.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/ev_posix.h"

@ -37,11 +37,11 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/iomgr_internal.h"

@ -39,10 +39,10 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/ev_posix.h"

@ -34,11 +34,11 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/murmur_hash.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/wakeup_fd_cv.h"

@ -27,10 +27,10 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include "src/core/lib/iomgr/ev_epollex_linux.h"
#include "src/core/lib/iomgr/ev_epollsig_linux.h"

@ -25,11 +25,11 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#define MAX_DEPTH 2

@ -25,7 +25,6 @@
#include <grpc/fork.h>
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/fork.h"

@ -27,7 +27,6 @@
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/iomgr/iocp_windows.h"

@ -29,10 +29,10 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"

@ -31,10 +31,10 @@
#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/host_port.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"

@ -24,9 +24,9 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/host_port.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"

@ -27,8 +27,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/combiner.h"
grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota");

@ -21,11 +21,11 @@
#ifdef GRPC_POSIX_SOCKET
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/socket_factory_posix.h"
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
void grpc_socket_factory_init(grpc_socket_factory* factory,
const grpc_socket_factory_vtable* vtable) {

@ -18,11 +18,11 @@
#include "src/core/lib/iomgr/socket_mutator.h"
#include "src/core/lib/channel/channel_args.h"
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
void grpc_socket_mutator_init(grpc_socket_mutator* mutator,
const grpc_socket_mutator_vtable* vtable) {

@ -28,7 +28,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/iocp_windows.h"

@ -37,12 +37,12 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/profiling/timers.h"

@ -42,7 +42,6 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"

@ -30,8 +30,8 @@
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"

@ -29,11 +29,11 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/time_averaged_stats.h"
#include "src/core/lib/iomgr/timer_heap.h"

@ -25,7 +25,8 @@
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
/* Adjusts a heap so as to move a hole at position i closer to the root,
until a suitable position is found for element t. Then, copies t into that

@ -30,7 +30,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
void grpc_create_socketpair_if_unix(int sv[2]) {
GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);

@ -30,7 +30,8 @@
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#define MAX_TABLE_RESIZE 256

@ -25,7 +25,6 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
extern "C" {
#include <openssl/pem.h>

@ -23,8 +23,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/slice/slice_internal.h"
/* --- Constants. --- */

@ -23,8 +23,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/slice/slice_internal.h"
/* grow a buffer; requires GRPC_SLICE_BUFFER_INLINE_ELEMENTS > 1 */

@ -28,13 +28,13 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/compression/algorithm_metadata.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/arena.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"

@ -19,7 +19,6 @@
#include "src/core/lib/surface/channel_init.h"
#include <grpc/support/alloc.h>
#include <grpc/support/useful.h>
typedef struct stage_slot {
grpc_channel_init_stage fn;

@ -25,7 +25,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h"

@ -21,7 +21,7 @@
#include <inttypes.h>
#include <stdlib.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
grpc_core::TraceFlag grpc_bdp_estimator_trace(false, "bdp_estimator");

@ -21,8 +21,8 @@
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
extern grpc_core::DebugOnlyTraceFlag grpc_trace_metadata;

@ -17,7 +17,8 @@
*/
#include "src/core/lib/transport/pid_controller.h"
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
namespace grpc_core {

@ -27,7 +27,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/connectivity_state.h"

@ -24,7 +24,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/transport_security_grpc.h"

@ -37,7 +37,6 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
extern "C" {
#include <openssl/bio.h>

@ -41,7 +41,6 @@
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/profiling/timers.h"

@ -23,8 +23,8 @@
#include <grpc++/server.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/gpr/useful.h"
#include "src/cpp/server/thread_pool_interface.h"
namespace grpc {

@ -18,7 +18,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/arena.cc',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/avl.cc',
'src/core/lib/gpr/cpu_iphone.cc',
'src/core/lib/gpr/cpu_linux.cc',
'src/core/lib/gpr/cpu_posix.cc',
@ -57,6 +56,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/profiling/basic_timers.cc',
'src/core/lib/profiling/stap_timers.cc',
'src/core/lib/surface/init.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_stack.cc',

@ -199,14 +199,6 @@ gpr_malloc_aligned_type gpr_malloc_aligned_import;
gpr_free_aligned_type gpr_free_aligned_import;
gpr_set_allocation_functions_type gpr_set_allocation_functions_import;
gpr_get_allocation_functions_type gpr_get_allocation_functions_import;
gpr_avl_create_type gpr_avl_create_import;
gpr_avl_ref_type gpr_avl_ref_import;
gpr_avl_unref_type gpr_avl_unref_import;
gpr_avl_add_type gpr_avl_add_import;
gpr_avl_remove_type gpr_avl_remove_import;
gpr_avl_get_type gpr_avl_get_import;
gpr_avl_maybe_get_type gpr_avl_maybe_get_import;
gpr_avl_is_empty_type gpr_avl_is_empty_import;
gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
gpr_log_severity_string_type gpr_log_severity_string_import;
@ -450,14 +442,6 @@ void grpc_rb_load_imports(HMODULE library) {
gpr_free_aligned_import = (gpr_free_aligned_type) GetProcAddress(library, "gpr_free_aligned");
gpr_set_allocation_functions_import = (gpr_set_allocation_functions_type) GetProcAddress(library, "gpr_set_allocation_functions");
gpr_get_allocation_functions_import = (gpr_get_allocation_functions_type) GetProcAddress(library, "gpr_get_allocation_functions");
gpr_avl_create_import = (gpr_avl_create_type) GetProcAddress(library, "gpr_avl_create");
gpr_avl_ref_import = (gpr_avl_ref_type) GetProcAddress(library, "gpr_avl_ref");
gpr_avl_unref_import = (gpr_avl_unref_type) GetProcAddress(library, "gpr_avl_unref");
gpr_avl_add_import = (gpr_avl_add_type) GetProcAddress(library, "gpr_avl_add");
gpr_avl_remove_import = (gpr_avl_remove_type) GetProcAddress(library, "gpr_avl_remove");
gpr_avl_get_import = (gpr_avl_get_type) GetProcAddress(library, "gpr_avl_get");
gpr_avl_maybe_get_import = (gpr_avl_maybe_get_type) GetProcAddress(library, "gpr_avl_maybe_get");
gpr_avl_is_empty_import = (gpr_avl_is_empty_type) GetProcAddress(library, "gpr_avl_is_empty");
gpr_cpu_num_cores_import = (gpr_cpu_num_cores_type) GetProcAddress(library, "gpr_cpu_num_cores");
gpr_cpu_current_cpu_import = (gpr_cpu_current_cpu_type) GetProcAddress(library, "gpr_cpu_current_cpu");
gpr_log_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string");

@ -33,7 +33,6 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/avl.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
@ -573,30 +572,6 @@ extern gpr_set_allocation_functions_type gpr_set_allocation_functions_import;
typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)(void);
extern gpr_get_allocation_functions_type gpr_get_allocation_functions_import;
#define gpr_get_allocation_functions gpr_get_allocation_functions_import
typedef gpr_avl(*gpr_avl_create_type)(const gpr_avl_vtable* vtable);
extern gpr_avl_create_type gpr_avl_create_import;
#define gpr_avl_create gpr_avl_create_import
typedef gpr_avl(*gpr_avl_ref_type)(gpr_avl avl, void* user_data);
extern gpr_avl_ref_type gpr_avl_ref_import;
#define gpr_avl_ref gpr_avl_ref_import
typedef void(*gpr_avl_unref_type)(gpr_avl avl, void* user_data);
extern gpr_avl_unref_type gpr_avl_unref_import;
#define gpr_avl_unref gpr_avl_unref_import
typedef gpr_avl(*gpr_avl_add_type)(gpr_avl avl, void* key, void* value, void* user_data);
extern gpr_avl_add_type gpr_avl_add_import;
#define gpr_avl_add gpr_avl_add_import
typedef gpr_avl(*gpr_avl_remove_type)(gpr_avl avl, void* key, void* user_data);
extern gpr_avl_remove_type gpr_avl_remove_import;
#define gpr_avl_remove gpr_avl_remove_import
typedef void*(*gpr_avl_get_type)(gpr_avl avl, void* key, void* user_data);
extern gpr_avl_get_type gpr_avl_get_import;
#define gpr_avl_get gpr_avl_get_import
typedef int(*gpr_avl_maybe_get_type)(gpr_avl avl, void* key, void** value, void* user_data);
extern gpr_avl_maybe_get_type gpr_avl_maybe_get_import;
#define gpr_avl_maybe_get gpr_avl_maybe_get_import
typedef int(*gpr_avl_is_empty_type)(gpr_avl avl);
extern gpr_avl_is_empty_type gpr_avl_is_empty_import;
#define gpr_avl_is_empty gpr_avl_is_empty_import
typedef unsigned(*gpr_cpu_num_cores_type)(void);
extern gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
#define gpr_cpu_num_cores gpr_cpu_num_cores_import

@ -0,0 +1,30 @@
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2
grpc_package(name = "test/core/avl")
grpc_cc_test(
name = "avl_test",
srcs = ["avl_test.cc"],
language = "C++",
deps = [
"//:gpr",
"//:grpc",
"//test/core/util:gpr_test_util",
],
)

File diff suppressed because it is too large Load Diff

@ -21,7 +21,6 @@
#include <algorithm>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include <gtest/gtest.h>
#include "test/core/util/test_config.h"

@ -21,9 +21,9 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
#include "src/core/lib/gpr/useful.h"
#include "test/core/bad_ssl/server_common.h"
#include "test/core/end2end/data/ssl_test_data.h"

@ -21,7 +21,6 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/iomgr/load_file.h"

@ -19,9 +19,9 @@
#include <string.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "test/core/util/test_config.h"

@ -23,7 +23,6 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/static_metadata.h"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save