diff --git a/BUILD b/BUILD
index 53dbfd4c97c..b56b31470f9 100644
--- a/BUILD
+++ b/BUILD
@@ -609,6 +609,7 @@ grpc_cc_library(
"include/grpcpp/security/binder_credentials.h",
],
deps = [
+ "config",
"gpr",
"gpr_base",
"gpr_platform",
@@ -805,7 +806,6 @@ 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/gprpp/arena.cc",
"src/core/lib/gprpp/examine_stack.cc",
"src/core/lib/gprpp/fork.cc",
"src/core/lib/gprpp/global_config_env.cc",
@@ -829,7 +829,6 @@ grpc_cc_library(
"src/core/lib/gpr/string_windows.h",
"src/core/lib/gpr/time_precise.h",
"src/core/lib/gpr/tmpfile.h",
- "src/core/lib/gprpp/arena.h",
"src/core/lib/gprpp/examine_stack.h",
"src/core/lib/gprpp/fork.h",
"src/core/lib/gprpp/global_config.h",
@@ -887,6 +886,7 @@ grpc_cc_library(
hdrs = ["src/core/lib/gprpp/chunked_vector.h"],
external_deps = ["absl/utility"],
deps = [
+ "arena",
# TODO(ctiller): weaken this to just arena when that splits into its own target
"gpr_base",
],
@@ -1099,6 +1099,7 @@ grpc_cc_library(
"src/core/lib/promise/arena_promise.h",
],
deps = [
+ "arena",
"gpr_base",
"poll",
],
@@ -1499,6 +1500,20 @@ grpc_cc_library(
],
)
+grpc_cc_library(
+ name = "arena",
+ srcs = [
+ "src/core/lib/resource_quota/arena.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resource_quota/arena.h",
+ ],
+ deps = [
+ "gpr_base",
+ "memory_quota",
+ ],
+)
+
grpc_cc_library(
name = "thread_quota",
srcs = [
@@ -2041,6 +2056,7 @@ grpc_cc_library(
public_hdrs = GRPC_PUBLIC_HDRS + GRPC_PUBLIC_EVENT_ENGINE_HDRS,
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
+ "arena",
"avl",
"bitset",
"channel_args",
@@ -3391,6 +3407,7 @@ grpc_cc_library(
visibility = ["@grpc:public"],
deps = [
"alts_util",
+ "arena",
"config",
"error",
"gpr_base",
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05ad8b18235..26ed8d317fc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1399,7 +1399,6 @@ add_library(gpr
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -1996,6 +1995,7 @@ add_library(grpc
src/core/lib/matchers/matchers.cc
src/core/lib/promise/activity.cc
src/core/lib/resource_quota/api.cc
+ src/core/lib/resource_quota/arena.cc
src/core/lib/resource_quota/memory_quota.cc
src/core/lib/resource_quota/resource_quota.cc
src/core/lib/resource_quota/thread_quota.cc
@@ -2642,6 +2642,7 @@ add_library(grpc_unsecure
src/core/lib/json/json_writer.cc
src/core/lib/promise/activity.cc
src/core/lib/resource_quota/api.cc
+ src/core/lib/resource_quota/arena.cc
src/core/lib/resource_quota/memory_quota.cc
src/core/lib/resource_quota/resource_quota.cc
src/core/lib/resource_quota/thread_quota.cc
@@ -7580,7 +7581,6 @@ add_executable(activity_test
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -7901,53 +7901,23 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(arena_promise_test
- src/core/ext/upb-generated/google/protobuf/any.upb.c
- src/core/ext/upb-generated/google/rpc/status.upb.c
- src/core/lib/gpr/alloc.cc
- src/core/lib/gpr/atm.cc
- src/core/lib/gpr/cpu_iphone.cc
- src/core/lib/gpr/cpu_linux.cc
- src/core/lib/gpr/cpu_posix.cc
- src/core/lib/gpr/cpu_windows.cc
- src/core/lib/gpr/env_linux.cc
- src/core/lib/gpr/env_posix.cc
- src/core/lib/gpr/env_windows.cc
- src/core/lib/gpr/log.cc
- src/core/lib/gpr/log_android.cc
- src/core/lib/gpr/log_linux.cc
- src/core/lib/gpr/log_posix.cc
- src/core/lib/gpr/log_windows.cc
- src/core/lib/gpr/murmur_hash.cc
- src/core/lib/gpr/string.cc
- src/core/lib/gpr/string_posix.cc
- src/core/lib/gpr/string_util_windows.cc
- src/core/lib/gpr/string_windows.cc
- src/core/lib/gpr/sync.cc
- src/core/lib/gpr/sync_abseil.cc
- src/core/lib/gpr/sync_posix.cc
- src/core/lib/gpr/sync_windows.cc
- src/core/lib/gpr/time.cc
- src/core/lib/gpr/time_posix.cc
- src/core/lib/gpr/time_precise.cc
- src/core/lib/gpr/time_windows.cc
- src/core/lib/gpr/tmpfile_msys.cc
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
- src/core/lib/gprpp/host_port.cc
- src/core/lib/gprpp/mpscq.cc
- src/core/lib/gprpp/stat_posix.cc
- src/core/lib/gprpp/stat_windows.cc
- src/core/lib/gprpp/status_helper.cc
- src/core/lib/gprpp/thd_posix.cc
- src/core/lib/gprpp/thd_windows.cc
- src/core/lib/gprpp/time_util.cc
- src/core/lib/profiling/basic_timers.cc
- src/core/lib/profiling/stap_timers.cc
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ src/core/lib/slice/static_slice.cc
test/core/promise/arena_promise_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -7975,19 +7945,9 @@ target_include_directories(arena_promise_test
target_link_libraries(arena_promise_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- absl::base
- absl::core_headers
- absl::memory
- absl::random_random
- absl::status
- absl::cord
- absl::str_format
- absl::strings
- absl::synchronization
- absl::time
- absl::optional
+ absl::statusor
absl::variant
- upb
+ gpr
)
@@ -9164,53 +9124,23 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(chunked_vector_test
- src/core/ext/upb-generated/google/protobuf/any.upb.c
- src/core/ext/upb-generated/google/rpc/status.upb.c
- src/core/lib/gpr/alloc.cc
- src/core/lib/gpr/atm.cc
- src/core/lib/gpr/cpu_iphone.cc
- src/core/lib/gpr/cpu_linux.cc
- src/core/lib/gpr/cpu_posix.cc
- src/core/lib/gpr/cpu_windows.cc
- src/core/lib/gpr/env_linux.cc
- src/core/lib/gpr/env_posix.cc
- src/core/lib/gpr/env_windows.cc
- src/core/lib/gpr/log.cc
- src/core/lib/gpr/log_android.cc
- src/core/lib/gpr/log_linux.cc
- src/core/lib/gpr/log_posix.cc
- src/core/lib/gpr/log_windows.cc
- src/core/lib/gpr/murmur_hash.cc
- src/core/lib/gpr/string.cc
- src/core/lib/gpr/string_posix.cc
- src/core/lib/gpr/string_util_windows.cc
- src/core/lib/gpr/string_windows.cc
- src/core/lib/gpr/sync.cc
- src/core/lib/gpr/sync_abseil.cc
- src/core/lib/gpr/sync_posix.cc
- src/core/lib/gpr/sync_windows.cc
- src/core/lib/gpr/time.cc
- src/core/lib/gpr/time_posix.cc
- src/core/lib/gpr/time_precise.cc
- src/core/lib/gpr/time_windows.cc
- src/core/lib/gpr/tmpfile_msys.cc
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
- src/core/lib/gprpp/host_port.cc
- src/core/lib/gprpp/mpscq.cc
- src/core/lib/gprpp/stat_posix.cc
- src/core/lib/gprpp/stat_windows.cc
- src/core/lib/gprpp/status_helper.cc
- src/core/lib/gprpp/thd_posix.cc
- src/core/lib/gprpp/thd_windows.cc
- src/core/lib/gprpp/time_util.cc
- src/core/lib/profiling/basic_timers.cc
- src/core/lib/profiling/stap_timers.cc
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ src/core/lib/slice/static_slice.cc
test/core/gprpp/chunked_vector_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -9238,19 +9168,10 @@ target_include_directories(chunked_vector_test
target_link_libraries(chunked_vector_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- absl::base
- absl::core_headers
- absl::memory
- absl::random_random
- absl::status
- absl::cord
- absl::str_format
- absl::strings
- absl::synchronization
- absl::time
- absl::optional
+ absl::statusor
+ absl::variant
absl::utility
- upb
+ gpr
)
@@ -9864,7 +9785,6 @@ add_executable(core_configuration_test
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -10921,7 +10841,6 @@ add_executable(for_each_test
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -12665,7 +12584,6 @@ add_executable(latch_test
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -13328,7 +13246,6 @@ add_executable(observable_test
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -13601,7 +13518,6 @@ add_executable(pipe_test
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
diff --git a/Makefile b/Makefile
index a92c2cf595b..391f66cab98 100644
--- a/Makefile
+++ b/Makefile
@@ -925,7 +925,6 @@ LIBGPR_SRC = \
src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/wrap_memcpy.cc \
- src/core/lib/gprpp/arena.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
@@ -1492,6 +1491,7 @@ LIBGRPC_SRC = \
src/core/lib/matchers/matchers.cc \
src/core/lib/promise/activity.cc \
src/core/lib/resource_quota/api.cc \
+ src/core/lib/resource_quota/arena.cc \
src/core/lib/resource_quota/memory_quota.cc \
src/core/lib/resource_quota/resource_quota.cc \
src/core/lib/resource_quota/thread_quota.cc \
@@ -1986,6 +1986,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/json/json_writer.cc \
src/core/lib/promise/activity.cc \
src/core/lib/resource_quota/api.cc \
+ src/core/lib/resource_quota/arena.cc \
src/core/lib/resource_quota/memory_quota.cc \
src/core/lib/resource_quota/resource_quota.cc \
src/core/lib/resource_quota/thread_quota.cc \
diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml
index ca401100267..4661739ec5e 100644
--- a/build_autogenerated.yaml
+++ b/build_autogenerated.yaml
@@ -312,7 +312,6 @@ libs:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/construct_destruct.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/examine_stack.h
@@ -365,7 +364,6 @@ libs:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -868,6 +866,7 @@ libs:
- src/core/lib/promise/race.h
- src/core/lib/promise/seq.h
- src/core/lib/resource_quota/api.h
+ - src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/resource_quota.h
- src/core/lib/resource_quota/thread_quota.h
@@ -1457,6 +1456,7 @@ libs:
- src/core/lib/matchers/matchers.cc
- src/core/lib/promise/activity.cc
- src/core/lib/resource_quota/api.cc
+ - src/core/lib/resource_quota/arena.cc
- src/core/lib/resource_quota/memory_quota.cc
- src/core/lib/resource_quota/resource_quota.cc
- src/core/lib/resource_quota/thread_quota.cc
@@ -1971,6 +1971,7 @@ libs:
- src/core/lib/promise/race.h
- src/core/lib/promise/seq.h
- src/core/lib/resource_quota/api.h
+ - src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/resource_quota.h
- src/core/lib/resource_quota/thread_quota.h
@@ -2256,6 +2257,7 @@ libs:
- src/core/lib/json/json_writer.cc
- src/core/lib/promise/activity.cc
- src/core/lib/resource_quota/api.cc
+ - src/core/lib/resource_quota/arena.cc
- src/core/lib/resource_quota/memory_quota.cc
- src/core/lib/resource_quota/resource_quota.cc
- src/core/lib/resource_quota/thread_quota.cc
@@ -4354,7 +4356,6 @@ targets:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/construct_destruct.h
@@ -4423,7 +4424,6 @@ targets:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -4557,102 +4557,69 @@ targets:
build: test
language: c++
headers:
- - src/core/ext/upb-generated/google/protobuf/any.upb.h
- - src/core/ext/upb-generated/google/rpc/status.upb.h
- - src/core/lib/gpr/alloc.h
- - src/core/lib/gpr/env.h
- - src/core/lib/gpr/murmur_hash.h
- - src/core/lib/gpr/spinlock.h
- - src/core/lib/gpr/string.h
- - src/core/lib/gpr/string_windows.h
- - src/core/lib/gpr/time_precise.h
- - src/core/lib/gpr/tls.h
- - src/core/lib/gpr/tmpfile.h
- - src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- - src/core/lib/gprpp/construct_destruct.h
- - src/core/lib/gprpp/debug_location.h
- - src/core/lib/gprpp/examine_stack.h
- - src/core/lib/gprpp/fork.h
- - src/core/lib/gprpp/global_config.h
- - src/core/lib/gprpp/global_config_custom.h
- - src/core/lib/gprpp/global_config_env.h
- - src/core/lib/gprpp/global_config_generic.h
- - src/core/lib/gprpp/host_port.h
- - src/core/lib/gprpp/manual_constructor.h
- - src/core/lib/gprpp/memory.h
- - src/core/lib/gprpp/mpscq.h
- - src/core/lib/gprpp/stat.h
- - src/core/lib/gprpp/status_helper.h
- - src/core/lib/gprpp/sync.h
- - src/core/lib/gprpp/thd.h
- - src/core/lib/gprpp/time_util.h
- - src/core/lib/profiling/timers.h
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
- src/core/lib/promise/arena_promise.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
- src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - src/core/lib/slice/slice_utils.h
+ - src/core/lib/slice/static_slice.h
src:
- - src/core/ext/upb-generated/google/protobuf/any.upb.c
- - src/core/ext/upb-generated/google/rpc/status.upb.c
- - src/core/lib/gpr/alloc.cc
- - src/core/lib/gpr/atm.cc
- - src/core/lib/gpr/cpu_iphone.cc
- - src/core/lib/gpr/cpu_linux.cc
- - src/core/lib/gpr/cpu_posix.cc
- - src/core/lib/gpr/cpu_windows.cc
- - src/core/lib/gpr/env_linux.cc
- - src/core/lib/gpr/env_posix.cc
- - src/core/lib/gpr/env_windows.cc
- - src/core/lib/gpr/log.cc
- - src/core/lib/gpr/log_android.cc
- - src/core/lib/gpr/log_linux.cc
- - src/core/lib/gpr/log_posix.cc
- - src/core/lib/gpr/log_windows.cc
- - src/core/lib/gpr/murmur_hash.cc
- - src/core/lib/gpr/string.cc
- - src/core/lib/gpr/string_posix.cc
- - src/core/lib/gpr/string_util_windows.cc
- - src/core/lib/gpr/string_windows.cc
- - src/core/lib/gpr/sync.cc
- - src/core/lib/gpr/sync_abseil.cc
- - src/core/lib/gpr/sync_posix.cc
- - src/core/lib/gpr/sync_windows.cc
- - src/core/lib/gpr/time.cc
- - src/core/lib/gpr/time_posix.cc
- - src/core/lib/gpr/time_precise.cc
- - src/core/lib/gpr/time_windows.cc
- - src/core/lib/gpr/tmpfile_msys.cc
- - src/core/lib/gpr/tmpfile_posix.cc
- - src/core/lib/gpr/tmpfile_windows.cc
- - src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- - src/core/lib/gprpp/examine_stack.cc
- - src/core/lib/gprpp/fork.cc
- - src/core/lib/gprpp/global_config_env.cc
- - src/core/lib/gprpp/host_port.cc
- - src/core/lib/gprpp/mpscq.cc
- - src/core/lib/gprpp/stat_posix.cc
- - src/core/lib/gprpp/stat_windows.cc
- - src/core/lib/gprpp/status_helper.cc
- - src/core/lib/gprpp/thd_posix.cc
- - src/core/lib/gprpp/thd_windows.cc
- - src/core/lib/gprpp/time_util.cc
- - src/core/lib/profiling/basic_timers.cc
- - src/core/lib/profiling/stap_timers.cc
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - src/core/lib/slice/static_slice.cc
- test/core/promise/arena_promise_test.cc
deps:
- - absl/base:base
- - absl/base:core_headers
- - absl/memory:memory
- - absl/random:random
- - absl/status:status
- - absl/strings:cord
- - absl/strings:str_format
- - absl/strings:strings
- - absl/synchronization:synchronization
- - absl/time:time
- - absl/types:optional
+ - absl/status:statusor
- absl/types:variant
- - upb
+ - gpr
uses_polling: false
- name: async_end2end_test
gtest: true
@@ -5103,101 +5070,70 @@ targets:
build: test
language: c++
headers:
- - src/core/ext/upb-generated/google/protobuf/any.upb.h
- - src/core/ext/upb-generated/google/rpc/status.upb.h
- - src/core/lib/gpr/alloc.h
- - src/core/lib/gpr/env.h
- - src/core/lib/gpr/murmur_hash.h
- - src/core/lib/gpr/spinlock.h
- - src/core/lib/gpr/string.h
- - src/core/lib/gpr/string_windows.h
- - src/core/lib/gpr/time_precise.h
- - src/core/lib/gpr/tls.h
- - src/core/lib/gpr/tmpfile.h
- - src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/chunked_vector.h
- - src/core/lib/gprpp/construct_destruct.h
- - src/core/lib/gprpp/debug_location.h
- - src/core/lib/gprpp/examine_stack.h
- - src/core/lib/gprpp/fork.h
- - src/core/lib/gprpp/global_config.h
- - src/core/lib/gprpp/global_config_custom.h
- - src/core/lib/gprpp/global_config_env.h
- - src/core/lib/gprpp/global_config_generic.h
- - src/core/lib/gprpp/host_port.h
- - src/core/lib/gprpp/manual_constructor.h
- - src/core/lib/gprpp/memory.h
- - src/core/lib/gprpp/mpscq.h
- - src/core/lib/gprpp/stat.h
- - src/core/lib/gprpp/status_helper.h
- - src/core/lib/gprpp/sync.h
- - src/core/lib/gprpp/thd.h
- - src/core/lib/gprpp/time_util.h
- - src/core/lib/profiling/timers.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - src/core/lib/slice/slice_utils.h
+ - src/core/lib/slice/static_slice.h
src:
- - src/core/ext/upb-generated/google/protobuf/any.upb.c
- - src/core/ext/upb-generated/google/rpc/status.upb.c
- - src/core/lib/gpr/alloc.cc
- - src/core/lib/gpr/atm.cc
- - src/core/lib/gpr/cpu_iphone.cc
- - src/core/lib/gpr/cpu_linux.cc
- - src/core/lib/gpr/cpu_posix.cc
- - src/core/lib/gpr/cpu_windows.cc
- - src/core/lib/gpr/env_linux.cc
- - src/core/lib/gpr/env_posix.cc
- - src/core/lib/gpr/env_windows.cc
- - src/core/lib/gpr/log.cc
- - src/core/lib/gpr/log_android.cc
- - src/core/lib/gpr/log_linux.cc
- - src/core/lib/gpr/log_posix.cc
- - src/core/lib/gpr/log_windows.cc
- - src/core/lib/gpr/murmur_hash.cc
- - src/core/lib/gpr/string.cc
- - src/core/lib/gpr/string_posix.cc
- - src/core/lib/gpr/string_util_windows.cc
- - src/core/lib/gpr/string_windows.cc
- - src/core/lib/gpr/sync.cc
- - src/core/lib/gpr/sync_abseil.cc
- - src/core/lib/gpr/sync_posix.cc
- - src/core/lib/gpr/sync_windows.cc
- - src/core/lib/gpr/time.cc
- - src/core/lib/gpr/time_posix.cc
- - src/core/lib/gpr/time_precise.cc
- - src/core/lib/gpr/time_windows.cc
- - src/core/lib/gpr/tmpfile_msys.cc
- - src/core/lib/gpr/tmpfile_posix.cc
- - src/core/lib/gpr/tmpfile_windows.cc
- - src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- - src/core/lib/gprpp/examine_stack.cc
- - src/core/lib/gprpp/fork.cc
- - src/core/lib/gprpp/global_config_env.cc
- - src/core/lib/gprpp/host_port.cc
- - src/core/lib/gprpp/mpscq.cc
- - src/core/lib/gprpp/stat_posix.cc
- - src/core/lib/gprpp/stat_windows.cc
- - src/core/lib/gprpp/status_helper.cc
- - src/core/lib/gprpp/thd_posix.cc
- - src/core/lib/gprpp/thd_windows.cc
- - src/core/lib/gprpp/time_util.cc
- - src/core/lib/profiling/basic_timers.cc
- - src/core/lib/profiling/stap_timers.cc
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - src/core/lib/slice/static_slice.cc
- test/core/gprpp/chunked_vector_test.cc
deps:
- - absl/base:base
- - absl/base:core_headers
- - absl/memory:memory
- - absl/random:random
- - absl/status:status
- - absl/strings:cord
- - absl/strings:str_format
- - absl/strings:strings
- - absl/synchronization:synchronization
- - absl/time:time
- - absl/types:optional
+ - absl/status:statusor
+ - absl/types:variant
- absl/utility:utility
- - upb
+ - gpr
uses_polling: false
- name: cli_call_test
gtest: true
@@ -5412,7 +5348,6 @@ targets:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/construct_destruct.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/examine_stack.h
@@ -5471,7 +5406,6 @@ targets:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -5973,7 +5907,6 @@ targets:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/construct_destruct.h
@@ -6046,7 +5979,6 @@ targets:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -6617,7 +6549,6 @@ targets:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/construct_destruct.h
@@ -6686,7 +6617,6 @@ targets:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -6954,7 +6884,6 @@ targets:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/construct_destruct.h
- src/core/lib/gprpp/debug_location.h
@@ -7021,7 +6950,6 @@ targets:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -7121,7 +7049,6 @@ targets:
- src/core/lib/gpr/tls.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/construct_destruct.h
@@ -7191,7 +7118,6 @@ targets:
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
diff --git a/config.m4 b/config.m4
index e0b617ca5b5..927915abb61 100644
--- a/config.m4
+++ b/config.m4
@@ -436,7 +436,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/wrap_memcpy.cc \
- src/core/lib/gprpp/arena.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
@@ -554,6 +553,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/profiling/stap_timers.cc \
src/core/lib/promise/activity.cc \
src/core/lib/resource_quota/api.cc \
+ src/core/lib/resource_quota/arena.cc \
src/core/lib/resource_quota/memory_quota.cc \
src/core/lib/resource_quota/resource_quota.cc \
src/core/lib/resource_quota/thread_quota.cc \
diff --git a/config.w32 b/config.w32
index d9df2d9bf18..5ad01e4785d 100644
--- a/config.w32
+++ b/config.w32
@@ -402,7 +402,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gpr\\tmpfile_posix.cc " +
"src\\core\\lib\\gpr\\tmpfile_windows.cc " +
"src\\core\\lib\\gpr\\wrap_memcpy.cc " +
- "src\\core\\lib\\gprpp\\arena.cc " +
"src\\core\\lib\\gprpp\\examine_stack.cc " +
"src\\core\\lib\\gprpp\\fork.cc " +
"src\\core\\lib\\gprpp\\global_config_env.cc " +
@@ -520,6 +519,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\profiling\\stap_timers.cc " +
"src\\core\\lib\\promise\\activity.cc " +
"src\\core\\lib\\resource_quota\\api.cc " +
+ "src\\core\\lib\\resource_quota\\arena.cc " +
"src\\core\\lib\\resource_quota\\memory_quota.cc " +
"src\\core\\lib\\resource_quota\\resource_quota.cc " +
"src\\core\\lib\\resource_quota\\thread_quota.cc " +
diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec
index a2a07be1307..8a42c509ef1 100644
--- a/gRPC-C++.podspec
+++ b/gRPC-C++.podspec
@@ -609,7 +609,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@@ -732,6 +731,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/race.h',
'src/core/lib/promise/seq.h',
'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/resource_quota.h',
'src/core/lib/resource_quota/thread_quota.h',
@@ -1332,7 +1332,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@@ -1455,6 +1454,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/race.h',
'src/core/lib/promise/seq.h',
'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/resource_quota.h',
'src/core/lib/resource_quota/thread_quota.h',
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index 04b8dc3fff1..2f4761ae343 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -944,8 +944,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tmpfile_windows.cc',
'src/core/lib/gpr/useful.h',
'src/core/lib/gpr/wrap_memcpy.cc',
- 'src/core/lib/gprpp/arena.cc',
- 'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@@ -1185,6 +1183,8 @@ Pod::Spec.new do |s|
'src/core/lib/promise/seq.h',
'src/core/lib/resource_quota/api.cc',
'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.cc',
+ 'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/memory_quota.cc',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/resource_quota.cc',
@@ -1869,7 +1869,6 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/tls.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/arena.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@@ -1992,6 +1991,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/race.h',
'src/core/lib/promise/seq.h',
'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/resource_quota.h',
'src/core/lib/resource_quota/thread_quota.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index cf8cf19a38f..008a4fbb627 100644
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -863,8 +863,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/tmpfile_windows.cc )
s.files += %w( src/core/lib/gpr/useful.h )
s.files += %w( src/core/lib/gpr/wrap_memcpy.cc )
- s.files += %w( src/core/lib/gprpp/arena.cc )
- s.files += %w( src/core/lib/gprpp/arena.h )
s.files += %w( src/core/lib/gprpp/atomic_utils.h )
s.files += %w( src/core/lib/gprpp/bitset.h )
s.files += %w( src/core/lib/gprpp/chunked_vector.h )
@@ -1104,6 +1102,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/promise/seq.h )
s.files += %w( src/core/lib/resource_quota/api.cc )
s.files += %w( src/core/lib/resource_quota/api.h )
+ s.files += %w( src/core/lib/resource_quota/arena.cc )
+ s.files += %w( src/core/lib/resource_quota/arena.h )
s.files += %w( src/core/lib/resource_quota/memory_quota.cc )
s.files += %w( src/core/lib/resource_quota/memory_quota.h )
s.files += %w( src/core/lib/resource_quota/resource_quota.cc )
diff --git a/grpc.gyp b/grpc.gyp
index 976f43bb802..5b91b16d56f 100644
--- a/grpc.gyp
+++ b/grpc.gyp
@@ -447,7 +447,6 @@
'src/core/lib/gpr/tmpfile_posix.cc',
'src/core/lib/gpr/tmpfile_windows.cc',
'src/core/lib/gpr/wrap_memcpy.cc',
- 'src/core/lib/gprpp/arena.cc',
'src/core/lib/gprpp/examine_stack.cc',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
@@ -947,6 +946,7 @@
'src/core/lib/matchers/matchers.cc',
'src/core/lib/promise/activity.cc',
'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/arena.cc',
'src/core/lib/resource_quota/memory_quota.cc',
'src/core/lib/resource_quota/resource_quota.cc',
'src/core/lib/resource_quota/thread_quota.cc',
@@ -1413,6 +1413,7 @@
'src/core/lib/json/json_writer.cc',
'src/core/lib/promise/activity.cc',
'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/arena.cc',
'src/core/lib/resource_quota/memory_quota.cc',
'src/core/lib/resource_quota/resource_quota.cc',
'src/core/lib/resource_quota/thread_quota.cc',
diff --git a/package.xml b/package.xml
index 2077c664735..0d3df25549c 100644
--- a/package.xml
+++ b/package.xml
@@ -843,8 +843,6 @@
-
-
@@ -1084,6 +1082,8 @@
+
+
diff --git a/src/core/ext/filters/client_channel/backend_metric.h b/src/core/ext/filters/client_channel/backend_metric.h
index 64f8ef61570..70efe6b7f94 100644
--- a/src/core/ext/filters/client_channel/backend_metric.h
+++ b/src/core/ext/filters/client_channel/backend_metric.h
@@ -22,7 +22,7 @@
#include
#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice.h"
namespace grpc_core {
diff --git a/src/core/ext/filters/client_channel/config_selector.h b/src/core/ext/filters/client_channel/config_selector.h
index 5feb3313c42..655afa03a2d 100644
--- a/src/core/ext/filters/client_channel/config_selector.h
+++ b/src/core/ext/filters/client_channel/config_selector.h
@@ -31,9 +31,9 @@
#include "src/core/ext/service_config/service_config_call_data.h"
#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/metadata_batch.h"
// Channel arg key for ConfigSelector.
diff --git a/src/core/ext/filters/client_channel/dynamic_filters.h b/src/core/ext/filters/client_channel/dynamic_filters.h
index 08a7f4985eb..03211ec1085 100644
--- a/src/core/ext/filters/client_channel/dynamic_filters.h
+++ b/src/core/ext/filters/client_channel/dynamic_filters.h
@@ -23,10 +23,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/resource_quota/arena.h"
namespace grpc_core {
diff --git a/src/core/ext/filters/client_channel/health/health_check_client.cc b/src/core/ext/filters/client_channel/health/health_check_client.cc
index 5da3fe387ae..a5c8ed61a9a 100644
--- a/src/core/ext/filters/client_channel/health/health_check_client.cc
+++ b/src/core/ext/filters/client_channel/health/health_check_client.cc
@@ -29,6 +29,7 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/proto/grpc/health/v1/health.upb.h"
@@ -60,6 +61,10 @@ HealthCheckClient::HealthCheckClient(
connected_subchannel_(std::move(connected_subchannel)),
interested_parties_(interested_parties),
channelz_node_(std::move(channelz_node)),
+ call_allocator_(
+ ResourceQuotaFromChannelArgs(connected_subchannel_->args())
+ ->memory_quota()
+ ->CreateMemoryAllocator(service_name_)),
watcher_(std::move(watcher)),
retry_backoff_(
BackOff::Options()
@@ -254,7 +259,8 @@ HealthCheckClient::CallState::CallState(
: health_check_client_(std::move(health_check_client)),
pollent_(grpc_polling_entity_create_from_pollset_set(interested_parties)),
arena_(Arena::Create(health_check_client_->connected_subchannel_
- ->GetInitialCallSizeEstimate())),
+ ->GetInitialCallSizeEstimate(),
+ &health_check_client_->call_allocator_)),
payload_(context_),
send_initial_metadata_(arena_),
send_trailing_metadata_(arena_),
diff --git a/src/core/ext/filters/client_channel/health/health_check_client.h b/src/core/ext/filters/client_channel/health/health_check_client.h
index 86e2fd2eaba..c22ea1986d7 100644
--- a/src/core/ext/filters/client_channel/health/health_check_client.h
+++ b/src/core/ext/filters/client_channel/health/health_check_client.h
@@ -29,7 +29,6 @@
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/lib/backoff/backoff.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
@@ -37,6 +36,7 @@
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
@@ -60,7 +60,7 @@ class HealthCheckClient : public InternallyRefCounted {
class CallState : public Orphanable {
public:
CallState(RefCountedPtr health_check_client,
- grpc_pollset_set* interested_parties_);
+ grpc_pollset_set* interested_parties);
~CallState() override;
void Orphan() override;
@@ -155,6 +155,7 @@ class HealthCheckClient : public InternallyRefCounted {
RefCountedPtr connected_subchannel_;
grpc_pollset_set* interested_parties_; // Do not own.
RefCountedPtr channelz_node_;
+ MemoryAllocator call_allocator_;
Mutex mu_;
RefCountedPtr watcher_
diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h
index d956d3e60c4..6a38d2870dd 100644
--- a/src/core/ext/filters/client_channel/subchannel.h
+++ b/src/core/ext/filters/client_channel/subchannel.h
@@ -27,13 +27,13 @@
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata.h"
diff --git a/src/core/ext/transport/binder/client/channel_create_impl.cc b/src/core/ext/transport/binder/client/channel_create_impl.cc
index 63449dbcb54..e8ffc9aa784 100644
--- a/src/core/ext/transport/binder/client/channel_create_impl.cc
+++ b/src/core/ext/transport/binder/client/channel_create_impl.cc
@@ -25,6 +25,7 @@
#include "src/core/ext/transport/binder/transport/binder_transport.h"
#include "src/core/ext/transport/binder/wire_format/binder.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
@@ -53,6 +54,9 @@ grpc_channel* CreateDirectBinderChannelImplForTesting(
grpc_arg default_authority_arg = grpc_channel_arg_string_create(
const_cast(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast("binder.authority"));
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
grpc_channel_args* final_args =
grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
grpc_error_handle error = GRPC_ERROR_NONE;
@@ -61,6 +65,7 @@ grpc_channel* CreateDirectBinderChannelImplForTesting(
GRPC_CLIENT_DIRECT_CHANNEL, transport, &error);
// TODO(mingcl): Handle error properly
GPR_ASSERT(error == GRPC_ERROR_NONE);
+ grpc_channel_args_destroy(args);
grpc_channel_args_destroy(final_args);
return channel;
}
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index acdb5a9fd38..c819c1a7fec 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -650,10 +650,6 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
: t(t),
refcount(refcount),
reffer(this),
- stream_reservation(t->memory_owner.MakeReservation(
- grpc_core::kResourceQuotaCallSize)), // TODO(ctiller): sizeof(*this),
- // or better, move allocation to
- // memory quota.
initial_metadata_buffer(arena),
trailing_metadata_buffer(arena) {
if (server_data) {
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index e9e6ef143a7..bbb8932221e 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -523,8 +523,6 @@ struct grpc_chttp2_stream {
explicit Reffer(grpc_chttp2_stream* s);
} reffer;
- grpc_core::MemoryAllocator::Reservation stream_reservation;
-
grpc_closure destroy_stream;
grpc_closure* destroy_stream_arg;
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index 5e6b3594db8..0f3504f85b7 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -54,9 +54,9 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/transport.h"
typedef struct grpc_channel_element grpc_channel_element;
diff --git a/src/core/lib/channel/channel_stack_builder.cc b/src/core/lib/channel/channel_stack_builder.cc
index b9c0e4c7f91..05bbae71d37 100644
--- a/src/core/lib/channel/channel_stack_builder.cc
+++ b/src/core/lib/channel/channel_stack_builder.cc
@@ -69,9 +69,9 @@ void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder* b,
b->target = gpr_strdup(target);
}
-const char* grpc_channel_stack_builder_get_target(
+std::string grpc_channel_stack_builder_get_target(
grpc_channel_stack_builder* b) {
- return b->target;
+ return b->target == nullptr ? std::string() : std::string(b->target);
}
static grpc_channel_stack_builder_iterator* create_iterator_at_filter_node(
diff --git a/src/core/lib/channel/channel_stack_builder.h b/src/core/lib/channel/channel_stack_builder.h
index 0071aa960f5..5518329cd74 100644
--- a/src/core/lib/channel/channel_stack_builder.h
+++ b/src/core/lib/channel/channel_stack_builder.h
@@ -43,7 +43,7 @@ void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder* builder,
void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder* b,
const char* target);
-const char* grpc_channel_stack_builder_get_target(
+std::string grpc_channel_stack_builder_get_target(
grpc_channel_stack_builder* b);
/// Attach \a transport to the builder (does not take ownership)
diff --git a/src/core/lib/gprpp/chunked_vector.h b/src/core/lib/gprpp/chunked_vector.h
index 256fa908b4e..feb982f96b5 100644
--- a/src/core/lib/gprpp/chunked_vector.h
+++ b/src/core/lib/gprpp/chunked_vector.h
@@ -17,8 +17,8 @@
#include
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/resource_quota/arena.h"
namespace grpc_core {
diff --git a/src/core/lib/promise/arena_promise.h b/src/core/lib/promise/arena_promise.h
index 35d914d3c2b..a62a6c21269 100644
--- a/src/core/lib/promise/arena_promise.h
+++ b/src/core/lib/promise/arena_promise.h
@@ -19,8 +19,8 @@
#include
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/promise/poll.h"
+#include "src/core/lib/resource_quota/arena.h"
namespace grpc_core {
diff --git a/src/core/lib/resource_quota/api.h b/src/core/lib/resource_quota/api.h
index c531813038f..40d0a0525f4 100644
--- a/src/core/lib/resource_quota/api.h
+++ b/src/core/lib/resource_quota/api.h
@@ -27,7 +27,6 @@ namespace grpc_core {
// TODO(ctiller): This is a hack. We need to do real accounting instead of
// hard coding.
-constexpr size_t kResourceQuotaCallSize = 15 * 1024;
constexpr size_t kResourceQuotaChannelSize = 50 * 1024;
// Retrieve the resource quota from the channel args.
diff --git a/src/core/lib/gprpp/arena.cc b/src/core/lib/resource_quota/arena.cc
similarity index 74%
rename from src/core/lib/gprpp/arena.cc
rename to src/core/lib/resource_quota/arena.cc
index 9e979de39ae..7d7e1857b56 100644
--- a/src/core/lib/gprpp/arena.cc
+++ b/src/core/lib/resource_quota/arena.cc
@@ -18,7 +18,7 @@
#include
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
#include
@@ -61,22 +61,24 @@ Arena::~Arena() {
}
}
-Arena* Arena::Create(size_t initial_size) {
- return new (ArenaStorage(initial_size)) Arena(initial_size);
+Arena* Arena::Create(size_t initial_size, MemoryAllocator* memory_allocator) {
+ return new (ArenaStorage(initial_size))
+ Arena(initial_size, 0, memory_allocator);
}
-std::pair Arena::CreateWithAlloc(size_t initial_size,
- size_t alloc_size) {
+std::pair Arena::CreateWithAlloc(
+ size_t initial_size, size_t alloc_size, MemoryAllocator* memory_allocator) {
static constexpr size_t base_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
- auto* new_arena =
- new (ArenaStorage(initial_size)) Arena(initial_size, alloc_size);
+ auto* new_arena = new (ArenaStorage(initial_size))
+ Arena(initial_size, alloc_size, memory_allocator);
void* first_alloc = reinterpret_cast(new_arena) + base_size;
return std::make_pair(new_arena, first_alloc);
}
size_t Arena::Destroy() {
size_t size = total_used_.load(std::memory_order_relaxed);
+ memory_allocator_->Release(total_allocated_.load(std::memory_order_relaxed));
this->~Arena();
gpr_free_aligned(this);
return size;
@@ -91,13 +93,14 @@ void* Arena::AllocZone(size_t size) {
static constexpr size_t zone_base_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Zone));
size_t alloc_size = zone_base_size + size;
+ memory_allocator_->Reserve(alloc_size);
+ total_allocated_.fetch_add(alloc_size, std::memory_order_relaxed);
Zone* z = new (gpr_malloc_aligned(alloc_size, GPR_MAX_ALIGNMENT)) Zone();
- {
- gpr_spinlock_lock(&arena_growth_spinlock_);
- z->prev = last_zone_;
- last_zone_ = z;
- gpr_spinlock_unlock(&arena_growth_spinlock_);
- }
+ auto* prev = last_zone_.load(std::memory_order_relaxed);
+ do {
+ z->prev = prev;
+ } while (!last_zone_.compare_exchange_weak(prev, z, std::memory_order_relaxed,
+ std::memory_order_relaxed));
return reinterpret_cast(z) + zone_base_size;
}
diff --git a/src/core/lib/gprpp/arena.h b/src/core/lib/resource_quota/arena.h
similarity index 80%
rename from src/core/lib/gprpp/arena.h
rename to src/core/lib/resource_quota/arena.h
index 3967f2f8e85..f071d3431d3 100644
--- a/src/core/lib/gprpp/arena.h
+++ b/src/core/lib/resource_quota/arena.h
@@ -22,8 +22,8 @@
// Tracks the total memory allocated against it, so that future arenas can
// pre-allocate the right amount of memory
-#ifndef GRPC_CORE_LIB_GPRPP_ARENA_H
-#define GRPC_CORE_LIB_GPRPP_ARENA_H
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H
#include
@@ -38,20 +38,21 @@
#include
#include "src/core/lib/gpr/alloc.h"
-#include "src/core/lib/gpr/spinlock.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
namespace grpc_core {
class Arena {
public:
// Create an arena, with \a initial_size bytes in the first allocated buffer.
- static Arena* Create(size_t initial_size);
+ static Arena* Create(size_t initial_size, MemoryAllocator* memory_allocator);
// Create an arena, with \a initial_size bytes in the first allocated buffer,
// and return both a void pointer to the returned arena and a void* with the
// first allocation.
- static std::pair CreateWithAlloc(size_t initial_size,
- size_t alloc_size);
+ static std::pair CreateWithAlloc(
+ size_t initial_size, size_t alloc_size,
+ MemoryAllocator* memory_allocator);
// Destroy an arena, returning the total number of bytes allocated.
size_t Destroy();
@@ -96,9 +97,11 @@ class Arena {
// quick optimization (avoiding an atomic fetch-add) for the common case
// where we wish to create an arena and then perform an immediate
// allocation.
- explicit Arena(size_t initial_size, size_t initial_alloc = 0)
+ explicit Arena(size_t initial_size, size_t initial_alloc,
+ MemoryAllocator* memory_allocator)
: total_used_(GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_alloc)),
- initial_zone_size_(initial_size) {}
+ initial_zone_size_(initial_size),
+ memory_allocator_(memory_allocator) {}
~Arena();
@@ -107,14 +110,16 @@ class Arena {
// Keep track of the total used size. We use this in our call sizing
// hysteresis.
std::atomic total_used_{0};
+ std::atomic total_allocated_{0};
const size_t initial_zone_size_;
- gpr_spinlock arena_growth_spinlock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
// If the initial arena allocation wasn't enough, we allocate additional zones
// in a reverse linked list. Each additional zone consists of (1) a pointer to
// the zone added before this zone (null if this is the first additional zone)
// and (2) the allocated memory. The arena itself maintains a pointer to the
// last zone; the zone list is reverse-walked during arena destruction only.
- Zone* last_zone_ = nullptr;
+ std::atomic last_zone_{nullptr};
+ // The backing memory quota
+ MemoryAllocator* const memory_allocator_;
};
// Smart pointer for arenas when the final size is not required.
@@ -122,10 +127,11 @@ struct ScopedArenaDeleter {
void operator()(Arena* arena) { arena->Destroy(); }
};
using ScopedArenaPtr = std::unique_ptr;
-inline ScopedArenaPtr MakeScopedArena(size_t initial_size) {
- return ScopedArenaPtr(Arena::Create(initial_size));
+inline ScopedArenaPtr MakeScopedArena(size_t initial_size,
+ MemoryAllocator* memory_allocator) {
+ return ScopedArenaPtr(Arena::Create(initial_size, memory_allocator));
}
} // namespace grpc_core
-#endif /* GRPC_CORE_LIB_GPRPP_ARENA_H */
+#endif /* GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H */
diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc
index 257f5c25cb0..7e0aa2b8e2d 100644
--- a/src/core/lib/security/context/security_context.cc
+++ b/src/core/lib/security/context/security_context.cc
@@ -29,9 +29,9 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h
index 6ff4856e6bd..2c695931b56 100644
--- a/src/core/lib/security/context/security_context.h
+++ b/src/core/lib/security/context/security_context.h
@@ -21,10 +21,10 @@
#include
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/security/credentials/credentials.h"
extern grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount;
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc
index 082ba66fd2c..b17b5bb2a5e 100644
--- a/src/core/lib/surface/call.cc
+++ b/src/core/lib/surface/call.cc
@@ -45,11 +45,11 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_split.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/slice/slice_utils.h"
@@ -362,7 +362,8 @@ grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
call_and_stack_size + (args->parent ? sizeof(child_call) : 0);
std::pair arena_with_call =
- grpc_core::Arena::CreateWithAlloc(initial_size, call_alloc_size);
+ grpc_core::Arena::CreateWithAlloc(initial_size, call_alloc_size,
+ &*args->channel->allocator);
arena = arena_with_call.first;
call = new (arena_with_call.second) grpc_call(arena, *args);
*out_call = call;
diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h
index e16a6be520e..8074395bd09 100644
--- a/src/core/lib/surface/call.h
+++ b/src/core/lib/surface/call.h
@@ -26,7 +26,7 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc
index d10cb074a49..9df3dc9938d 100644
--- a/src/core/lib/surface/channel.cc
+++ b/src/core/lib/surface/channel.cc
@@ -41,6 +41,7 @@
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
@@ -59,7 +60,7 @@ static void destroy_channel(void* arg, grpc_error_handle error);
grpc_channel* grpc_channel_create_with_builder(
grpc_channel_stack_builder* builder,
grpc_channel_stack_type channel_stack_type, grpc_error_handle* error) {
- char* target = gpr_strdup(grpc_channel_stack_builder_get_target(builder));
+ std::string target = grpc_channel_stack_builder_get_target(builder);
grpc_channel_args* args = grpc_channel_args_copy(
grpc_channel_stack_builder_get_channel_arguments(builder));
grpc_channel* channel;
@@ -68,6 +69,7 @@ grpc_channel* grpc_channel_create_with_builder(
} else {
GRPC_STATS_INC_CLIENT_CHANNELS_CREATED();
}
+ std::string name = grpc_channel_stack_builder_get_target(builder);
grpc_error_handle builder_error = grpc_channel_stack_builder_finish(
builder, sizeof(grpc_channel), 1, destroy_channel, nullptr,
reinterpret_cast(&channel));
@@ -80,13 +82,15 @@ grpc_channel* grpc_channel_create_with_builder(
} else {
GRPC_ERROR_UNREF(builder_error);
}
- gpr_free(target);
grpc_channel_args_destroy(args);
return nullptr;
}
- channel->target = target;
+ channel->target.Init(std::move(target));
channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type);
channel->registration_table.Init();
+ channel->allocator.Init(grpc_core::ResourceQuotaFromChannelArgs(args)
+ ->memory_quota()
+ ->CreateMemoryOwner(name));
gpr_atm_no_barrier_store(
&channel->call_size_estimate,
@@ -197,11 +201,10 @@ void CreateChannelzNode(grpc_channel_stack_builder* builder) {
const bool is_internal_channel = grpc_channel_args_find_bool(
args, GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL, false);
// Create the channelz node.
- const char* target = grpc_channel_stack_builder_get_target(builder);
+ std::string target = grpc_channel_stack_builder_get_target(builder);
grpc_core::RefCountedPtr channelz_node =
grpc_core::MakeRefCounted(
- target != nullptr ? target : "", channel_tracer_max_memory,
- is_internal_channel);
+ target.c_str(), channel_tracer_max_memory, is_internal_channel);
channelz_node->AddTraceEvent(
grpc_core::channelz::ChannelTrace::Severity::Info,
grpc_slice_from_static_string("Channel created"));
@@ -313,7 +316,7 @@ void grpc_channel_update_call_size_estimate(grpc_channel* channel,
char* grpc_channel_get_target(grpc_channel* channel) {
GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel));
- return gpr_strdup(channel->target);
+ return gpr_strdup(channel->target->c_str());
}
void grpc_channel_get_info(grpc_channel* channel,
@@ -486,7 +489,8 @@ static void destroy_channel(void* arg, grpc_error_handle /*error*/) {
}
grpc_channel_stack_destroy(CHANNEL_STACK_FROM_CHANNEL(channel));
channel->registration_table.Destroy();
- gpr_free(channel->target);
+ channel->allocator.Destroy();
+ channel->target.Destroy();
gpr_free(channel);
// See comment in grpc_channel_create() for why we do this.
grpc_shutdown();
diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h
index 9037d2e1a7a..3641398449b 100644
--- a/src/core/lib/surface/channel.h
+++ b/src/core/lib/surface/channel.h
@@ -110,8 +110,9 @@ struct grpc_channel {
grpc_core::ManualConstructor
registration_table;
grpc_core::RefCountedPtr channelz_node;
+ grpc_core::ManualConstructor allocator;
- char* target;
+ grpc_core::ManualConstructor target;
};
#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack*)((c) + 1))
diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h
index 72440cda5ca..577e439dc4d 100644
--- a/src/core/lib/transport/transport.h
+++ b/src/core/lib/transport/transport.h
@@ -24,13 +24,13 @@
#include
#include "src/core/lib/channel/context.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/connectivity_state.h"
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index e4d6f61b9f5..91a14dde9ce 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -411,7 +411,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/gpr/tmpfile_posix.cc',
'src/core/lib/gpr/tmpfile_windows.cc',
'src/core/lib/gpr/wrap_memcpy.cc',
- 'src/core/lib/gprpp/arena.cc',
'src/core/lib/gprpp/examine_stack.cc',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
@@ -529,6 +528,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/profiling/stap_timers.cc',
'src/core/lib/promise/activity.cc',
'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/arena.cc',
'src/core/lib/resource_quota/memory_quota.cc',
'src/core/lib/resource_quota/resource_quota.cc',
'src/core/lib/resource_quota/thread_quota.cc',
diff --git a/test/core/end2end/fixtures/h2_sockpair.cc b/test/core/end2end/fixtures/h2_sockpair.cc
index 794becf5760..d9b02fa80f7 100644
--- a/test/core/end2end/fixtures/h2_sockpair.cc
+++ b/test/core/end2end/fixtures/h2_sockpair.cc
@@ -114,15 +114,15 @@ static void chttp2_init_client_socketpair(
auto* fixture_data = static_cast(f->fixture_data);
grpc_transport* transport;
sp_client_setup cs;
- cs.client_args = client_args;
- cs.f = f;
client_args = grpc_core::CoreConfiguration::Get()
.channel_args_preconditioning()
.PreconditionChannelArgs(client_args);
+ cs.client_args = client_args;
+ cs.f = f;
transport =
grpc_create_chttp2_transport(client_args, fixture_data->ep.client, true);
- grpc_channel_args_destroy(client_args);
client_setup_transport(&cs, transport);
+ grpc_channel_args_destroy(client_args);
GPR_ASSERT(f->client);
}
diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.cc b/test/core/end2end/fixtures/h2_sockpair_1byte.cc
index b9616d0199a..95f51af46e4 100644
--- a/test/core/end2end/fixtures/h2_sockpair_1byte.cc
+++ b/test/core/end2end/fixtures/h2_sockpair_1byte.cc
@@ -125,15 +125,15 @@ static void chttp2_init_client_socketpair(
auto* fixture_data = static_cast(f->fixture_data);
grpc_transport* transport;
sp_client_setup cs;
- cs.client_args = client_args;
- cs.f = f;
client_args = grpc_core::CoreConfiguration::Get()
.channel_args_preconditioning()
.PreconditionChannelArgs(client_args);
+ cs.client_args = client_args;
+ cs.f = f;
transport =
grpc_create_chttp2_transport(client_args, fixture_data->ep.client, true);
- grpc_channel_args_destroy(client_args);
client_setup_transport(&cs, transport);
+ grpc_channel_args_destroy(client_args);
GPR_ASSERT(f->client);
}
diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc
index a3e1068b77b..cf2769707b3 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.cc
+++ b/test/core/end2end/fuzzers/api_fuzzer.cc
@@ -189,7 +189,8 @@ static void do_connect(void* arg, grpc_error_handle error) {
core_server->channel_args(), server, false);
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"SetupTransport",
- core_server->SetupTransport(transport, nullptr, nullptr, nullptr)));
+ core_server->SetupTransport(transport, nullptr,
+ core_server->channel_args(), nullptr)));
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, fc->closure, GRPC_ERROR_NONE);
diff --git a/test/core/end2end/fuzzers/client_fuzzer.cc b/test/core/end2end/fuzzers/client_fuzzer.cc
index 39fbf24fc6c..6db3b3b19e4 100644
--- a/test/core/end2end/fuzzers/client_fuzzer.cc
+++ b/test/core/end2end/fuzzers/client_fuzzer.cc
@@ -62,9 +62,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
const_cast(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast("test-authority"));
args = grpc_channel_args_copy_and_add(nullptr, &authority_arg, 1);
- grpc_channel* channel = grpc_channel_create(
- "test-target", args, GRPC_CLIENT_DIRECT_CHANNEL, transport, nullptr);
+ const grpc_channel_args* channel_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel* channel =
+ grpc_channel_create("test-target", channel_args,
+ GRPC_CLIENT_DIRECT_CHANNEL, transport, nullptr);
grpc_channel_args_destroy(args);
+ grpc_channel_args_destroy(channel_args);
grpc_slice host = grpc_slice_from_static_string("localhost");
grpc_call* call = grpc_channel_create_call(
channel, nullptr, 0, cq, grpc_slice_from_static_string("/foo"), &host,
diff --git a/test/core/end2end/fuzzers/server_fuzzer.cc b/test/core/end2end/fuzzers/server_fuzzer.cc
index 7e70f2b5b4e..30fc573820e 100644
--- a/test/core/end2end/fuzzers/server_fuzzer.cc
+++ b/test/core/end2end/fuzzers/server_fuzzer.cc
@@ -58,11 +58,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
.PreconditionChannelArgs(nullptr);
grpc_transport* transport =
grpc_create_chttp2_transport(channel_args, mock_endpoint, false);
- grpc_channel_args_destroy(channel_args);
grpc_resource_quota_unref(resource_quota);
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"SetupTransport", grpc_core::Server::FromC(server)->SetupTransport(
- transport, nullptr, nullptr, nullptr)));
+ transport, nullptr, channel_args, nullptr)));
+ grpc_channel_args_destroy(channel_args);
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
grpc_call* call1 = nullptr;
diff --git a/test/core/gpr/arena_test.cc b/test/core/gpr/arena_test.cc
index 64bd0589897..6fc2a6314d9 100644
--- a/test/core/gpr/arena_test.cc
+++ b/test/core/gpr/arena_test.cc
@@ -16,7 +16,7 @@
*
*/
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
#include
#include
@@ -32,11 +32,16 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "test/core/util/test_config.h"
using grpc_core::Arena;
-static void test_noop(void) { Arena::Create(1)->Destroy(); }
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
+static void test_noop(void) { Arena::Create(1, g_memory_allocator)->Destroy(); }
static void test(const char* name, size_t init_size, const size_t* allocs,
size_t nallocs) {
@@ -50,7 +55,7 @@ static void test(const char* name, size_t init_size, const size_t* allocs,
std::string s = absl::StrJoin(parts, "");
gpr_log(GPR_INFO, "%s", s.c_str());
- Arena* a = Arena::Create(init_size);
+ Arena* a = Arena::Create(init_size, g_memory_allocator);
void** ps = static_cast(gpr_zalloc(sizeof(*ps) * nallocs));
for (size_t i = 0; i < nallocs; i++) {
ps[i] = a->Alloc(allocs[i]);
@@ -96,7 +101,7 @@ static void concurrent_test(void) {
concurrent_test_args args;
gpr_event_init(&args.ev_start);
- args.arena = Arena::Create(1024);
+ args.arena = Arena::Create(1024, g_memory_allocator);
grpc_core::Thread thds[CONCURRENT_TEST_THREADS];
diff --git a/test/core/gprpp/BUILD b/test/core/gprpp/BUILD
index 9bb380d45fd..99dcbec8110 100644
--- a/test/core/gprpp/BUILD
+++ b/test/core/gprpp/BUILD
@@ -306,6 +306,7 @@ grpc_cc_test(
deps = [
"//:chunked_vector",
"//:gpr_base",
+ "//:resource_quota",
"//test/core/util:grpc_suppressions",
],
)
@@ -320,6 +321,7 @@ grpc_proto_fuzzer(
uses_polling = False,
deps = [
"//:chunked_vector",
+ "//:resource_quota",
"//test/core/util:grpc_test_util",
],
)
diff --git a/test/core/gprpp/chunked_vector_fuzzer.cc b/test/core/gprpp/chunked_vector_fuzzer.cc
index 1704e3e789c..52b55773e5d 100644
--- a/test/core/gprpp/chunked_vector_fuzzer.cc
+++ b/test/core/gprpp/chunked_vector_fuzzer.cc
@@ -15,12 +15,17 @@
#include
#include "src/core/lib/gprpp/chunked_vector.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/gprpp/chunked_vector_fuzzer.pb.h"
bool squelch = true;
bool leak_check = true;
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
static constexpr size_t kChunkSize = 17;
using IntHdl = std::shared_ptr;
@@ -139,7 +144,7 @@ class Fuzzer {
return &vectors_.emplace(index, Comparison(arena_.get())).first->second;
}
- ScopedArenaPtr arena_ = MakeScopedArena(128);
+ ScopedArenaPtr arena_ = MakeScopedArena(128, g_memory_allocator);
std::map vectors_;
};
} // namespace grpc_core
diff --git a/test/core/gprpp/chunked_vector_test.cc b/test/core/gprpp/chunked_vector_test.cc
index 274bc0f3b15..fbd8c557909 100644
--- a/test/core/gprpp/chunked_vector_test.cc
+++ b/test/core/gprpp/chunked_vector_test.cc
@@ -16,20 +16,25 @@
#include
+#include "src/core/lib/resource_quota/resource_quota.h"
+
namespace grpc_core {
namespace testing {
+static auto* g_memory_allocator = new MemoryAllocator(
+ ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator("test"));
+
static constexpr size_t kInitialArenaSize = 1024;
static constexpr size_t kChunkSize = 3;
TEST(ChunkedVector, Noop) {
- auto arena = MakeScopedArena(kInitialArenaSize);
+ auto arena = MakeScopedArena(kInitialArenaSize, g_memory_allocator);
ChunkedVector v(arena.get());
EXPECT_EQ(0, v.size());
}
TEST(ChunkedVector, Stack) {
- auto arena = MakeScopedArena(kInitialArenaSize);
+ auto arena = MakeScopedArena(kInitialArenaSize, g_memory_allocator);
ChunkedVector v(arena.get());
// Populate 2 chunks of memory, and 2/3 of a final chunk.
@@ -71,7 +76,7 @@ TEST(ChunkedVector, Stack) {
}
TEST(ChunkedVector, Iterate) {
- auto arena = MakeScopedArena(kInitialArenaSize);
+ auto arena = MakeScopedArena(kInitialArenaSize, g_memory_allocator);
ChunkedVector v(arena.get());
v.EmplaceBack(1);
v.EmplaceBack(2);
@@ -103,7 +108,7 @@ TEST(ChunkedVector, Iterate) {
}
TEST(ChunkedVector, ConstIterate) {
- auto arena = MakeScopedArena(kInitialArenaSize);
+ auto arena = MakeScopedArena(kInitialArenaSize, g_memory_allocator);
ChunkedVector v(arena.get());
v.EmplaceBack(1);
v.EmplaceBack(2);
@@ -135,7 +140,7 @@ TEST(ChunkedVector, ConstIterate) {
}
TEST(ChunkedVector, Clear) {
- auto arena = MakeScopedArena(kInitialArenaSize);
+ auto arena = MakeScopedArena(kInitialArenaSize, g_memory_allocator);
ChunkedVector v(arena.get());
v.EmplaceBack(1);
EXPECT_EQ(v.size(), 1);
diff --git a/test/core/promise/BUILD b/test/core/promise/BUILD
index 66dd1d9ab5e..41061142e3e 100644
--- a/test/core/promise/BUILD
+++ b/test/core/promise/BUILD
@@ -75,6 +75,7 @@ grpc_cc_test(
uses_polling = False,
deps = [
"//:arena_promise",
+ "//:resource_quota",
"//test/core/util:grpc_suppressions",
],
)
diff --git a/test/core/promise/arena_promise_test.cc b/test/core/promise/arena_promise_test.cc
index 561373202c7..ff065b1a4c2 100644
--- a/test/core/promise/arena_promise_test.cc
+++ b/test/core/promise/arena_promise_test.cc
@@ -18,10 +18,15 @@
#include
+#include "src/core/lib/resource_quota/resource_quota.h"
+
namespace grpc_core {
+static auto* g_memory_allocator = new MemoryAllocator(
+ ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator("test"));
+
TEST(ArenaPromiseTest, AllocatedWorks) {
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
int x = 42;
ArenaPromise p(arena.get(), [x] { return Poll(x); });
EXPECT_EQ(p(), Poll(42));
@@ -30,7 +35,7 @@ TEST(ArenaPromiseTest, AllocatedWorks) {
}
TEST(ArenaPromiseTest, DestructionWorks) {
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
auto x = std::make_shared(42);
auto p = ArenaPromise(arena.get(), [x] { return Poll(*x); });
ArenaPromise q(std::move(p));
diff --git a/test/core/transport/binder/binder_transport_test.cc b/test/core/transport/binder/binder_transport_test.cc
index c323608ad13..09b7c44ce78 100644
--- a/test/core/transport/binder/binder_transport_test.cc
+++ b/test/core/transport/binder/binder_transport_test.cc
@@ -32,9 +32,14 @@
#include
#include "src/core/ext/transport/binder/transport/binder_stream.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "test/core/transport/binder/mock_objects.h"
#include "test/core/util/test_config.h"
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
namespace grpc_binder {
namespace {
@@ -45,7 +50,8 @@ using ::testing::Return;
class BinderTransportTest : public ::testing::Test {
public:
BinderTransportTest()
- : arena_(grpc_core::Arena::Create(/* initial_size = */ 1)),
+ : arena_(grpc_core::Arena::Create(/* initial_size = */ 1,
+ g_memory_allocator)),
transport_(grpc_create_binder_transport_client(
absl::make_unique>(),
std::make_shared<
@@ -211,7 +217,8 @@ struct MakeSendInitialMetadata {
std::vector storage;
grpc_linked_mdelem method_ref_storage;
- grpc_core::ScopedArenaPtr arena = grpc_core::MakeScopedArena(1024);
+ grpc_core::ScopedArenaPtr arena =
+ grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch grpc_initial_metadata{arena.get()};
};
@@ -243,7 +250,8 @@ struct MakeSendTrailingMetadata {
&grpc_trailing_metadata;
}
- grpc_core::ScopedArenaPtr arena = grpc_core::MakeScopedArena(1024);
+ grpc_core::ScopedArenaPtr arena =
+ grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch grpc_trailing_metadata{arena.get()};
};
@@ -266,7 +274,8 @@ struct MakeRecvInitialMetadata {
~MakeRecvInitialMetadata() {}
MockGrpcClosure ready;
- grpc_core::ScopedArenaPtr arena = grpc_core::MakeScopedArena(1024);
+ grpc_core::ScopedArenaPtr arena =
+ grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch grpc_initial_metadata{arena.get()};
absl::Notification notification;
};
@@ -309,7 +318,8 @@ struct MakeRecvTrailingMetadata {
~MakeRecvTrailingMetadata() {}
MockGrpcClosure ready;
- grpc_core::ScopedArenaPtr arena = grpc_core::MakeScopedArena(1024);
+ grpc_core::ScopedArenaPtr arena =
+ grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch grpc_trailing_metadata{arena.get()};
absl::Notification notification;
};
diff --git a/test/core/transport/binder/end2end/testing_channel_create.cc b/test/core/transport/binder/end2end/testing_channel_create.cc
index 75dd531d3f4..485a1d0e706 100644
--- a/test/core/transport/binder/end2end/testing_channel_create.cc
+++ b/test/core/transport/binder/end2end/testing_channel_create.cc
@@ -21,6 +21,7 @@
#include "src/core/ext/transport/binder/transport/binder_transport.h"
#include "src/core/ext/transport/binder/wire_format/wire_reader_impl.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/error_utils.h"
@@ -107,14 +108,16 @@ std::shared_ptr BinderChannelForTesting(
} // namespace end2end_testing
} // namespace grpc_binder
-grpc_channel* grpc_binder_channel_create_for_testing(grpc_server* server,
- grpc_channel_args* args,
- void* /*reserved*/) {
+grpc_channel* grpc_binder_channel_create_for_testing(
+ grpc_server* server, const grpc_channel_args* args, void* /*reserved*/) {
grpc_core::ExecCtx exec_ctx;
grpc_arg default_authority_arg = grpc_channel_arg_string_create(
const_cast(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast("test.authority"));
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
grpc_channel_args* client_args =
grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
@@ -128,6 +131,7 @@ grpc_channel* grpc_binder_channel_create_for_testing(grpc_server* server,
grpc_channel_create("binder", client_args, GRPC_CLIENT_DIRECT_CHANNEL,
client_transport, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
+ grpc_channel_args_destroy(args);
grpc_channel_args_destroy(client_args);
return channel;
}
diff --git a/test/core/transport/binder/end2end/testing_channel_create.h b/test/core/transport/binder/end2end/testing_channel_create.h
index 97058c330d0..d0bf06ea54a 100644
--- a/test/core/transport/binder/end2end/testing_channel_create.h
+++ b/test/core/transport/binder/end2end/testing_channel_create.h
@@ -35,8 +35,7 @@ std::shared_ptr BinderChannelForTesting(
} // namespace end2end_testing
} // namespace grpc_binder
-grpc_channel* grpc_binder_channel_create_for_testing(grpc_server* server,
- grpc_channel_args* args,
- void* /*reserved*/);
+grpc_channel* grpc_binder_channel_create_for_testing(
+ grpc_server* server, const grpc_channel_args* args, void* /*reserved*/);
#endif // GRPC_TEST_CORE_TRANSPORT_BINDER_END2END_TESTING_CHANNEL_CREATE_H
diff --git a/test/core/transport/chttp2/hpack_encoder_test.cc b/test/core/transport/chttp2/hpack_encoder_test.cc
index d59248cf8fd..edb7ae48222 100644
--- a/test/core/transport/chttp2/hpack_encoder_test.cc
+++ b/test/core/transport/chttp2/hpack_encoder_test.cc
@@ -32,6 +32,7 @@
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
#include "src/core/ext/transport/chttp2/transport/hpack_utils.h"
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/metadata.h"
@@ -41,6 +42,10 @@
#define TEST(x) run_test(x, #x)
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
grpc_core::HPackCompressor* g_compressor;
int g_failure = 0;
@@ -161,7 +166,7 @@ static void verify(const verify_params params, const char* expected,
va_list l;
grpc_linked_mdelem* e =
static_cast(gpr_malloc(sizeof(*e) * nheaders));
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch b(arena.get());
va_start(l, nheaders);
@@ -244,7 +249,7 @@ static void test_basic_headers() {
static void verify_continuation_headers(const char* key, const char* value,
bool is_eof) {
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_slice_buffer output;
grpc_mdelem elem = grpc_mdelem_from_slices(
grpc_slice_intern(grpc_slice_from_static_string(key)),
@@ -327,7 +332,7 @@ static void test_decode_table_overflow() {
static void verify_table_size_change_match_elem_size(const char* key,
const char* value,
bool use_true_binary) {
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_slice_buffer output;
grpc_mdelem elem = grpc_mdelem_from_slices(
grpc_slice_intern(grpc_slice_from_static_string(key)),
diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
index 99e0eeacab0..63aab2fbab6 100644
--- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
+++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
@@ -25,6 +25,7 @@
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/transport/chttp2/hpack_parser_fuzzer.pb.h"
@@ -38,10 +39,13 @@ DEFINE_PROTO_FUZZER(const hpack_parser_fuzzer::Msg& msg) {
grpc_test_only_set_slice_hash_seed(0);
if (squelch) gpr_set_log_function(dont_log);
grpc_init();
+ auto memory_allocator = grpc_core::ResourceQuota::Default()
+ ->memory_quota()
+ ->CreateMemoryAllocator("test-allocator");
{
std::unique_ptr parser(new grpc_core::HPackParser);
for (int i = 0; i < msg.frames_size(); i++) {
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, &memory_allocator);
grpc_core::ExecCtx exec_ctx;
grpc_metadata_batch b(arena.get());
diff --git a/test/core/transport/chttp2/hpack_parser_test.cc b/test/core/transport/chttp2/hpack_parser_test.cc
index 30b89df24ef..1280684a604 100644
--- a/test/core/transport/chttp2/hpack_parser_test.cc
+++ b/test/core/transport/chttp2/hpack_parser_test.cc
@@ -26,10 +26,15 @@
#include
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "test/core/util/parse_hexstring.h"
#include "test/core/util/slice_splitter.h"
#include "test/core/util/test_config.h"
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
struct TestInput {
const char* input;
const char* expected_parse;
@@ -67,7 +72,7 @@ class ParseTest : public ::testing::TestWithParam {
void TestVector(grpc_slice_split_mode mode, const char* hexstring,
std::string expect) {
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_core::ExecCtx exec_ctx;
grpc_slice input = parse_hexstring(hexstring);
grpc_slice* slices;
diff --git a/test/core/transport/metadata_map_test.cc b/test/core/transport/metadata_map_test.cc
index 91e58c6bb32..99e29398df3 100644
--- a/test/core/transport/metadata_map_test.cc
+++ b/test/core/transport/metadata_map_test.cc
@@ -16,6 +16,7 @@
#include
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "test/core/util/test_config.h"
@@ -23,18 +24,21 @@
namespace grpc_core {
namespace testing {
+static auto* g_memory_allocator = new MemoryAllocator(
+ ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator("test"));
+
TEST(MetadataMapTest, Noop) {
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
MetadataMap<>(arena.get());
}
TEST(MetadataMapTest, NoopWithDeadline) {
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
MetadataMap(arena.get());
}
TEST(MetadataMapTest, SimpleOps) {
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
MetadataMap map(arena.get());
EXPECT_EQ(map.get_pointer(GrpcTimeoutMetadata()), nullptr);
EXPECT_EQ(map.get(GrpcTimeoutMetadata()), absl::nullopt);
@@ -70,7 +74,7 @@ class FakeEncoder {
TEST(MetadataMapTest, EmptyEncodeTest) {
FakeEncoder encoder;
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
MetadataMap map(arena.get());
map.Encode(&encoder);
EXPECT_EQ(encoder.output(), "");
@@ -78,7 +82,7 @@ TEST(MetadataMapTest, EmptyEncodeTest) {
TEST(MetadataMapTest, TimeoutEncodeTest) {
FakeEncoder encoder;
- auto arena = MakeScopedArena(1024);
+ auto arena = MakeScopedArena(1024, g_memory_allocator);
MetadataMap map(arena.get());
map.Set(GrpcTimeoutMetadata(), 1234);
map.Encode(&encoder);
diff --git a/test/core/transport/metadata_test.cc b/test/core/transport/metadata_test.cc
index 81569297017..5579ac54d7d 100644
--- a/test/core/transport/metadata_test.cc
+++ b/test/core/transport/metadata_test.cc
@@ -35,6 +35,7 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/static_metadata.h"
@@ -43,6 +44,10 @@
/* a large number */
#define MANY 10000
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
static grpc_slice maybe_intern(grpc_slice in, bool intern) {
grpc_slice out = intern ? grpc_slice_intern(in) : grpc_slice_ref(in);
grpc_slice_unref(in);
@@ -308,7 +313,7 @@ static void test_copied_static_metadata(bool dup_key, bool dup_value) {
}
static void test_grpc_metadata_batch_get_value_with_absent_key(void) {
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch metadata(arena.get());
std::string concatenated_value;
absl::optional value =
@@ -319,7 +324,7 @@ static void test_grpc_metadata_batch_get_value_with_absent_key(void) {
static void test_grpc_metadata_batch_get_value_returns_one_value(void) {
const char* kKey = "some_key";
const char* kValue = "some_value";
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_linked_mdelem storage;
grpc_metadata_batch metadata(arena.get());
storage.md = grpc_mdelem_from_slices(
@@ -337,7 +342,7 @@ static void test_grpc_metadata_batch_get_value_returns_multiple_values(void) {
const char* kKey = "some_key";
const char* kValue1 = "value1";
const char* kValue2 = "value2";
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_linked_mdelem storage1;
grpc_linked_mdelem storage2;
grpc_metadata_batch metadata(arena.get());
@@ -357,7 +362,7 @@ static void test_grpc_metadata_batch_get_value_returns_multiple_values(void) {
}
static void test_grpc_chttp2_incoming_metadata_replace_or_add_works(void) {
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch buffer(arena.get());
GRPC_LOG_IF_ERROR("incoming_buffer_add",
buffer.Append(grpc_mdelem_from_slices(
diff --git a/test/core/util/evaluate_args_test_util.h b/test/core/util/evaluate_args_test_util.h
index ab12dc5d043..1d5bf4c53a8 100644
--- a/test/core/util/evaluate_args_test_util.h
+++ b/test/core/util/evaluate_args_test_util.h
@@ -56,7 +56,10 @@ class EvaluateArgsTestUtil {
}
private:
- ScopedArenaPtr arena_ = MakeScopedArena(1024);
+ MemoryAllocator allocator_ =
+ ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "EvaluateArgsTestUtil");
+ ScopedArenaPtr arena_ = MakeScopedArena(1024, &allocator_);
grpc_metadata_batch metadata_{arena_.get()};
MockAuthorizationEndpoint endpoint_{/*local_uri=*/"", /*peer_uri=*/""};
grpc_auth_context auth_context_{nullptr};
diff --git a/test/cpp/microbenchmarks/bm_arena.cc b/test/cpp/microbenchmarks/bm_arena.cc
index aba5ceb68be..6b1a9fc058c 100644
--- a/test/cpp/microbenchmarks/bm_arena.cc
+++ b/test/cpp/microbenchmarks/bm_arena.cc
@@ -20,22 +20,27 @@
#include
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "test/core/util/test_config.h"
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
using grpc_core::Arena;
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
static void BM_Arena_NoOp(benchmark::State& state) {
for (auto _ : state) {
- Arena::Create(state.range(0))->Destroy();
+ Arena::Create(state.range(0), g_memory_allocator)->Destroy();
}
}
BENCHMARK(BM_Arena_NoOp)->Range(1, 1024 * 1024);
static void BM_Arena_ManyAlloc(benchmark::State& state) {
- Arena* a = Arena::Create(state.range(0));
+ Arena* a = Arena::Create(state.range(0), g_memory_allocator);
const size_t realloc_after =
1024 * 1024 * 1024 / ((state.range(1) + 15) & 0xffffff0u);
while (state.KeepRunning()) {
@@ -43,7 +48,7 @@ static void BM_Arena_ManyAlloc(benchmark::State& state) {
// periodically recreate arena to avoid OOM
if (state.iterations() % realloc_after == 0) {
a->Destroy();
- a = Arena::Create(state.range(0));
+ a = Arena::Create(state.range(0), g_memory_allocator);
}
}
a->Destroy();
@@ -52,7 +57,7 @@ BENCHMARK(BM_Arena_ManyAlloc)->Ranges({{1, 1024 * 1024}, {1, 32 * 1024}});
static void BM_Arena_Batch(benchmark::State& state) {
for (auto _ : state) {
- Arena* a = Arena::Create(state.range(0));
+ Arena* a = Arena::Create(state.range(0), g_memory_allocator);
for (int i = 0; i < state.range(1); i++) {
a->Alloc(state.range(2));
}
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index 02e8952a61f..9882fe0f70e 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -39,8 +39,10 @@
#include "src/core/ext/filters/message_size/message_size_filter.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/transport_impl.h"
#include "src/cpp/client/create_channel_internal.h"
@@ -49,6 +51,10 @@
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
void BM_Zalloc(benchmark::State& state) {
// speed of light for call creation is zalloc, so benchmark a few interesting
// sizes
@@ -535,14 +541,15 @@ static void BM_IsolatedFilter(benchmark::State& state) {
TestOp test_op_data;
const int kArenaSize = 4096;
grpc_call_context_element context[GRPC_CONTEXT_COUNT] = {};
- grpc_call_element_args call_args{call_stack,
- nullptr,
- context,
- method,
- start_time,
- deadline,
- grpc_core::Arena::Create(kArenaSize),
- nullptr};
+ grpc_call_element_args call_args{
+ call_stack,
+ nullptr,
+ context,
+ method,
+ start_time,
+ deadline,
+ grpc_core::Arena::Create(kArenaSize, g_memory_allocator),
+ nullptr};
while (state.KeepRunning()) {
GPR_TIMER_SCOPE("BenchmarkCycle", 0);
GRPC_ERROR_UNREF(
@@ -554,7 +561,8 @@ static void BM_IsolatedFilter(benchmark::State& state) {
// recreate arena every 64k iterations to avoid oom
if (0 == (state.iterations() & 0xffff)) {
call_args.arena->Destroy();
- call_args.arena = grpc_core::Arena::Create(kArenaSize);
+ call_args.arena =
+ grpc_core::Arena::Create(kArenaSize, g_memory_allocator);
}
}
call_args.arena->Destroy();
@@ -696,9 +704,13 @@ class IsolatedCallFixture : public TrackCounters {
// the grpc_shutdown() run by grpc_channel_destroy(). So we need to
// call grpc_init() manually here to balance things out.
grpc_init();
+ const grpc_channel_args* args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(nullptr);
grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
grpc_channel_stack_builder_set_name(builder, "phony");
grpc_channel_stack_builder_set_target(builder, "phony_target");
+ grpc_channel_stack_builder_set_channel_arguments(builder, args);
GPR_ASSERT(grpc_channel_stack_builder_append_filter(
builder, &isolated_call_filter::isolated_call_filter, nullptr,
nullptr));
@@ -708,6 +720,7 @@ class IsolatedCallFixture : public TrackCounters {
nullptr);
}
cq_ = grpc_completion_queue_create_for_next(nullptr);
+ grpc_channel_args_destroy(args);
}
void Finish(benchmark::State& state) override {
diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
index f12cdbffe26..e8491274d5a 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
@@ -30,6 +30,7 @@
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/metadata_batch.h"
@@ -39,6 +40,10 @@
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
static grpc_slice MakeSlice(std::vector bytes) {
grpc_slice s = grpc_slice_malloc(bytes.size());
uint8_t* p = GRPC_SLICE_START_PTR(s);
@@ -69,7 +74,7 @@ static void BM_HpackEncoderEncodeDeadline(benchmark::State& state) {
grpc_core::ExecCtx exec_ctx;
grpc_millis saved_now = grpc_core::ExecCtx::Get()->Now();
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch b(arena.get());
b.Set(grpc_core::GrpcTimeoutMetadata(), saved_now + 30 * 1000);
@@ -111,7 +116,7 @@ static void BM_HpackEncoderEncodeHeader(benchmark::State& state) {
grpc_core::ExecCtx exec_ctx;
static bool logged_representative_output = false;
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch b(arena.get());
Fixture::Prepare(&b);
@@ -468,7 +473,7 @@ static void BM_HpackParserParseHeader(benchmark::State& state) {
std::vector benchmark_slices = Fixture::GetBenchmarkSlices();
grpc_core::HPackParser p;
const int kArenaSize = 4096 * 4096;
- auto* arena = grpc_core::Arena::Create(kArenaSize);
+ auto* arena = grpc_core::Arena::Create(kArenaSize, g_memory_allocator);
grpc_core::ManualConstructor b;
b.Init(arena);
p.BeginFrame(&*b, std::numeric_limits::max(),
@@ -489,7 +494,7 @@ static void BM_HpackParserParseHeader(benchmark::State& state) {
if (0 == (state.iterations() & 0xfff)) {
b.Destroy();
arena->Destroy();
- arena = grpc_core::Arena::Create(kArenaSize);
+ arena = grpc_core::Arena::Create(kArenaSize, g_memory_allocator);
b.Init(arena);
p.BeginFrame(&*b, std::numeric_limits::max(),
grpc_core::HPackParser::Boundary::None,
diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
index 29ae1696b96..8765440d53f 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
@@ -41,6 +41,10 @@
#include "test/cpp/microbenchmarks/helpers.h"
#include "test/cpp/util/test_config.h"
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
+
////////////////////////////////////////////////////////////////////////////////
// Helper classes
//
@@ -196,7 +200,7 @@ class Stream {
explicit Stream(Fixture* f) : f_(f) {
stream_size_ = grpc_transport_stream_size(f->transport());
stream_ = gpr_malloc(stream_size_);
- arena_ = grpc_core::Arena::Create(4096);
+ arena_ = grpc_core::Arena::Create(4096, g_memory_allocator);
}
~Stream() {
@@ -212,7 +216,7 @@ class Stream {
memset(stream_, 0, stream_size_);
if ((state.iterations() & 0xffff) == 0) {
arena_->Destroy();
- arena_ = grpc_core::Arena::Create(4096);
+ arena_ = grpc_core::Arena::Create(4096, g_memory_allocator);
}
grpc_transport_init_stream(f_->transport(),
static_cast(stream_), &refcount_,
@@ -333,7 +337,7 @@ static void BM_StreamCreateSendInitialMetadataDestroy(benchmark::State& state) {
op.payload = &op_payload;
};
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch b(arena.get());
Metadata::Prepare(&b);
@@ -430,7 +434,7 @@ static void BM_TransportStreamSend(benchmark::State& state) {
grpc_slice send_slice = grpc_slice_malloc_large(state.range(0));
memset(GRPC_SLICE_START_PTR(send_slice), 0, GRPC_SLICE_LENGTH(send_slice));
grpc_core::ManualConstructor send_stream;
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch b(arena.get());
RepresentativeClientInitialMetadata::Prepare(&b);
@@ -564,7 +568,7 @@ static void BM_TransportStreamRecv(benchmark::State& state) {
op.payload = &op_payload;
};
- auto arena = grpc_core::MakeScopedArena(1024);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
grpc_metadata_batch b(arena.get());
RepresentativeClientInitialMetadata::Prepare(&b);
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index 51661f403d9..65164414dd1 100644
--- a/tools/doxygen/Doxyfile.c++.internal
+++ b/tools/doxygen/Doxyfile.c++.internal
@@ -1842,8 +1842,6 @@ src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/useful.h \
src/core/lib/gpr/wrap_memcpy.cc \
-src/core/lib/gprpp/arena.cc \
-src/core/lib/gprpp/arena.h \
src/core/lib/gprpp/atomic_utils.h \
src/core/lib/gprpp/bitset.h \
src/core/lib/gprpp/chunked_vector.h \
@@ -2083,6 +2081,8 @@ src/core/lib/promise/race.h \
src/core/lib/promise/seq.h \
src/core/lib/resource_quota/api.cc \
src/core/lib/resource_quota/api.h \
+src/core/lib/resource_quota/arena.cc \
+src/core/lib/resource_quota/arena.h \
src/core/lib/resource_quota/memory_quota.cc \
src/core/lib/resource_quota/memory_quota.h \
src/core/lib/resource_quota/resource_quota.cc \
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index 5a407a2a20e..a205835de3a 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -1640,8 +1640,6 @@ src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/useful.h \
src/core/lib/gpr/wrap_memcpy.cc \
src/core/lib/gprpp/README.md \
-src/core/lib/gprpp/arena.cc \
-src/core/lib/gprpp/arena.h \
src/core/lib/gprpp/atomic_utils.h \
src/core/lib/gprpp/bitset.h \
src/core/lib/gprpp/chunked_vector.h \
@@ -1882,6 +1880,8 @@ src/core/lib/promise/race.h \
src/core/lib/promise/seq.h \
src/core/lib/resource_quota/api.cc \
src/core/lib/resource_quota/api.h \
+src/core/lib/resource_quota/arena.cc \
+src/core/lib/resource_quota/arena.h \
src/core/lib/resource_quota/memory_quota.cc \
src/core/lib/resource_quota/memory_quota.h \
src/core/lib/resource_quota/resource_quota.cc \