Add buffer pool public apis

reviewable/pr8239/r2
Craig Tiller 9 years ago
parent ef5a2eb267
commit c2ab9aee0a
  1. 16
      include/grpc/grpc.h
  2. 5
      include/grpc/impl/codegen/grpc_types.h

@ -401,6 +401,22 @@ GRPCAPI int grpc_is_binary_header(const char *key, size_t length);
/** Convert grpc_call_error values to a string */
GRPCAPI const char *grpc_call_error_to_string(grpc_call_error error);
/** Create a buffer pool */
GRPCAPI grpc_buffer_pool *grpc_buffer_pool_create(void);
/** Add a reference to a buffer pool */
GRPCAPI void grpc_buffer_pool_ref(grpc_buffer_pool *buffer_pool);
/** Drop a reference to a buffer pool */
GRPCAPI void grpc_buffer_pool_unref(grpc_buffer_pool *buffer_pool);
/** Update the size of a buffer pool */
GRPCAPI void grpc_buffer_pool_resize(grpc_buffer_pool *buffer_pool,
size_t new_size);
/** Fetch a vtable for a grpc_channel_arg that points to a grpc_buffer_pool */
GRPCAPI grpc_arg_pointer_vtable *grpc_buffer_pool_arg_vtable(void);
#ifdef __cplusplus
}
#endif

@ -196,6 +196,9 @@ typedef struct {
#define GRPC_ARG_MAX_METADATA_SIZE "grpc.max_metadata_size"
/** If non-zero, allow the use of SO_REUSEPORT if it's available (default 1) */
#define GRPC_ARG_ALLOW_REUSEPORT "grpc.so_reuseport"
/** If non-zero, a pointer to a buffer pool (use grpc_buffer_pool_arg_vtable to
fetch an appropriate pointer arg vtable */
#define GRPC_ARG_BUFFER_POOL "grpc.buffer_pool"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
@ -445,6 +448,8 @@ typedef struct grpc_op {
} data;
} grpc_op;
typedef struct grpc_buffer_pool grpc_buffer_pool;
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save