Go to the documentation of this file.
19 #ifndef GRPC_IMPL_CODEGEN_SLICE_H
20 #define GRPC_IMPL_CODEGEN_SLICE_H
47 #define GRPC_SLICE_INLINE_EXTRA_SIZE sizeof(void*)
49 #define GRPC_SLICE_INLINED_SIZE \
50 (sizeof(size_t) + sizeof(uint8_t*) - 1 + GRPC_SLICE_INLINE_EXTRA_SIZE)
79 #define GRPC_SLICE_BUFFER_INLINE_ELEMENTS 8
101 #define GRPC_SLICE_START_PTR(slice) \
102 ((slice).refcount ? (slice).data.refcounted.bytes \
103 : (slice).data.inlined.bytes)
104 #define GRPC_SLICE_LENGTH(slice) \
105 ((slice).refcount ? (slice).data.refcounted.length \
106 : (slice).data.inlined.length)
107 #define GRPC_SLICE_SET_LENGTH(slice, newlen) \
108 ((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \
109 : ((slice).data.inlined.length = (uint8_t)(newlen)))
110 #define GRPC_SLICE_END_PTR(slice) \
111 GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice)
112 #define GRPC_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0)
114 #ifdef GRPC_ALLOW_GPR_SLICE_FUNCTIONS
117 #define GPR_SLICE_START_PTR(slice) \
118 ((slice).refcount ? (slice).data.refcounted.bytes \
119 : (slice).data.inlined.bytes)
120 #define GPR_SLICE_LENGTH(slice) \
121 ((slice).refcount ? (slice).data.refcounted.length \
122 : (slice).data.inlined.length)
123 #define GPR_SLICE_SET_LENGTH(slice, newlen) \
124 ((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \
125 : ((slice).data.inlined.length = (uint8_t)(newlen)))
126 #define GPR_SLICE_END_PTR(slice) \
127 GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice)
128 #define GPR_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0)
struct grpc_slice_refcount * refcount
struct grpc_slice::grpc_slice_data::grpc_slice_inlined inlined
struct grpc_slice::grpc_slice_data::grpc_slice_refcounted refcounted
union grpc_slice::grpc_slice_data data
#define GRPC_SLICE_BUFFER_INLINE_ELEMENTS
#define GRPC_SLICE_INLINED_SIZE
uint8_t bytes[GRPC_SLICE_INLINED_SIZE]
struct grpc_slice_buffer grpc_slice_buffer
grpc_slice inlined[GRPC_SLICE_BUFFER_INLINE_ELEMENTS]
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:18