slice_refcount.h
Go to the documentation of this file.
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H
16 #define GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H
17 
19 
20 #include <stdint.h>
21 
22 #include <grpc/slice.h>
23 
25 
26 namespace grpc_core {
27 
28 extern uint32_t g_hash_seed;
29 
30 } // namespace grpc_core
31 
33  if (reinterpret_cast<uintptr_t>(slice.refcount) > 1) {
34  slice.refcount->Ref();
35  }
36  return slice;
37 }
38 
40  if (reinterpret_cast<uintptr_t>(slice.refcount) > 1) {
41  slice.refcount->Unref();
42  }
43 }
44 
45 #endif /* GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H */
grpc_slice::refcount
struct grpc_slice_refcount * refcount
Definition: include/grpc/impl/codegen/slice.h:66
grpc_slice_ref_internal
const grpc_slice & grpc_slice_ref_internal(const grpc_slice &slice)
Definition: slice_refcount.h:32
slice.h
grpc_core
Definition: call_metric_recorder.h:31
grpc_slice_refcount::Ref
void Ref()
Definition: slice_refcount_base.h:43
slice_refcount_base.h
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
stdint.h
grpc_slice_refcount::Unref
void Unref()
Definition: slice_refcount_base.h:44
grpc_core::g_hash_seed
uint32_t g_hash_seed
Definition: slice_refcount.cc:23
grpc_slice_unref_internal
void grpc_slice_unref_internal(const grpc_slice &slice)
Definition: slice_refcount.h:39
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:19