From c645be488ec99dd306bf9c33a103553b26945b8b Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 28 Jul 2021 17:11:02 -0700 Subject: [PATCH] Remove gpr_arena (#26799) --- BUILD | 1 - BUILD.gn | 1 - build_autogenerated.yaml | 1 - gRPC-C++.podspec | 2 -- gRPC-Core.podspec | 2 -- grpc.gemspec | 1 - package.xml | 1 - src/core/lib/gpr/arena.h | 47 ---------------------------- tools/doxygen/Doxyfile.c++.internal | 1 - tools/doxygen/Doxyfile.core.internal | 1 - 10 files changed, 58 deletions(-) delete mode 100644 src/core/lib/gpr/arena.h diff --git a/BUILD b/BUILD index ff0257e7239..47658fe348d 100644 --- a/BUILD +++ b/BUILD @@ -660,7 +660,6 @@ grpc_cc_library( ], hdrs = [ "src/core/lib/gpr/alloc.h", - "src/core/lib/gpr/arena.h", "src/core/lib/gpr/env.h", "src/core/lib/gpr/murmur_hash.h", "src/core/lib/gpr/spinlock.h", diff --git a/BUILD.gn b/BUILD.gn index 29b2a471dc7..d03beafc83c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -121,7 +121,6 @@ config("grpc_config") { "src/core/ext/upb-generated/google/rpc/status.upb.h", "src/core/lib/gpr/alloc.cc", "src/core/lib/gpr/alloc.h", - "src/core/lib/gpr/arena.h", "src/core/lib/gpr/atm.cc", "src/core/lib/gpr/cpu_iphone.cc", "src/core/lib/gpr/cpu_linux.cc", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 76015a13ae3..24cb9eb4fbb 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -299,7 +299,6 @@ libs: - src/core/ext/upb-generated/google/protobuf/wrappers.upb.h - src/core/ext/upb-generated/google/rpc/status.upb.h - src/core/lib/gpr/alloc.h - - src/core/lib/gpr/arena.h - src/core/lib/gpr/env.h - src/core/lib/gpr/murmur_hash.h - src/core/lib/gpr/spinlock.h diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index b8d7afb2fb6..d7cfa1dba9b 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -521,7 +521,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/endpoint_config_internal.h', 'src/core/lib/event_engine/sockaddr.h', 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/arena.h', 'src/core/lib/gpr/env.h', 'src/core/lib/gpr/murmur_hash.h', 'src/core/lib/gpr/spinlock.h', @@ -1175,7 +1174,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/endpoint_config_internal.h', 'src/core/lib/event_engine/sockaddr.h', 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/arena.h', 'src/core/lib/gpr/env.h', 'src/core/lib/gpr/murmur_hash.h', 'src/core/lib/gpr/spinlock.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 31aca768174..8dd8217754e 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -853,7 +853,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/sockaddr.h', 'src/core/lib/gpr/alloc.cc', 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/arena.h', 'src/core/lib/gpr/atm.cc', 'src/core/lib/gpr/cpu_iphone.cc', 'src/core/lib/gpr/cpu_linux.cc', @@ -1755,7 +1754,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/endpoint_config_internal.h', 'src/core/lib/event_engine/sockaddr.h', 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/arena.h', 'src/core/lib/gpr/env.h', 'src/core/lib/gpr/murmur_hash.h', 'src/core/lib/gpr/spinlock.h', diff --git a/grpc.gemspec b/grpc.gemspec index c6ffbdb47a2..8107a2dd959 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -768,7 +768,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/sockaddr.h ) s.files += %w( src/core/lib/gpr/alloc.cc ) s.files += %w( src/core/lib/gpr/alloc.h ) - s.files += %w( src/core/lib/gpr/arena.h ) s.files += %w( src/core/lib/gpr/atm.cc ) s.files += %w( src/core/lib/gpr/cpu_iphone.cc ) s.files += %w( src/core/lib/gpr/cpu_linux.cc ) diff --git a/package.xml b/package.xml index 3d21edc3df1..af0acad0609 100644 --- a/package.xml +++ b/package.xml @@ -748,7 +748,6 @@ - diff --git a/src/core/lib/gpr/arena.h b/src/core/lib/gpr/arena.h deleted file mode 100644 index 4d70695149c..00000000000 --- a/src/core/lib/gpr/arena.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// \file Arena based allocator -// Allows very fast allocation of memory, but that memory cannot be freed until -// the arena as a whole is freed -// Tracks the total memory allocated against it, so that future arenas can -// pre-allocate the right amount of memory -// This transitional API is deprecated and will be removed soon in favour of -// src/core/lib/gprpp/arena.h . - -#ifndef GRPC_CORE_LIB_GPR_ARENA_H -#define GRPC_CORE_LIB_GPR_ARENA_H - -#include - -#include "src/core/lib/gprpp/arena.h" - -// TODO(arjunroy) : Remove deprecated gpr_arena API once all callers are gone. -typedef class grpc_core::Arena gpr_arena; -// Create an arena, with \a initial_size bytes in the first allocated buffer -inline gpr_arena* gpr_arena_create(size_t initial_size) { - return grpc_core::Arena::Create(initial_size); -} -// Destroy an arena, returning the total number of bytes allocated -inline size_t gpr_arena_destroy(gpr_arena* arena) { return arena->Destroy(); } -// Allocate \a size bytes from the arena -inline void* gpr_arena_alloc(gpr_arena* arena, size_t size) { - return arena->Alloc(size); -} - -#endif /* GRPC_CORE_LIB_GPR_ARENA_H */ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 4ac4cc38451..da9a2f3fb76 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1701,7 +1701,6 @@ src/core/lib/event_engine/sockaddr.cc \ src/core/lib/event_engine/sockaddr.h \ src/core/lib/gpr/alloc.cc \ src/core/lib/gpr/alloc.h \ -src/core/lib/gpr/arena.h \ src/core/lib/gpr/atm.cc \ src/core/lib/gpr/cpu_iphone.cc \ src/core/lib/gpr/cpu_linux.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 8aa3e4543e2..0445d640110 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1539,7 +1539,6 @@ src/core/lib/event_engine/sockaddr.h \ src/core/lib/gpr/README.md \ src/core/lib/gpr/alloc.cc \ src/core/lib/gpr/alloc.h \ -src/core/lib/gpr/arena.h \ src/core/lib/gpr/atm.cc \ src/core/lib/gpr/cpu_iphone.cc \ src/core/lib/gpr/cpu_linux.cc \