aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-05 11:36:49 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-09-06 09:53:19 -0700
commit9c519434be0ee80fcf66b433fc8c053ce9ac383b (patch)
treea10d0b6cd14efd9eb772961974b71333dd70e163
parent8271d0f3b4e64b4162a967bc920d80d7554603e4 (diff)
EXPERIMENT: Increase grpc_slice size to allow more inlining
-rw-r--r--include/grpc/impl/codegen/slice.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/grpc/impl/codegen/slice.h b/include/grpc/impl/codegen/slice.h
index a04c683a55..128fa8e121 100644
--- a/include/grpc/impl/codegen/slice.h
+++ b/include/grpc/impl/codegen/slice.h
@@ -62,7 +62,12 @@ typedef struct grpc_slice_refcount {
struct grpc_slice_refcount *sub_refcount;
} grpc_slice_refcount;
-#define GRPC_SLICE_INLINED_SIZE (sizeof(size_t) + sizeof(uint8_t *) - 1)
+/* Inlined half of grpc_slice is allowed to expand the size of the overall type
+ by this many bytes */
+#define GRPC_SLICE_INLINE_EXTRA_SIZE sizeof(void *)
+
+#define GRPC_SLICE_INLINED_SIZE \
+ (sizeof(size_t) + sizeof(uint8_t *) - 1 + GRPC_SLICE_INLINE_EXTRA_SIZE)
/** A grpc_slice s, if initialized, represents the byte range
s.bytes[0..s.length-1].