diff options
author | 2016-09-23 13:50:04 -0700 | |
---|---|---|
committer | 2016-09-23 13:50:04 -0700 | |
commit | d4673484c73c68f956c1bd6b9583048a124fe925 (patch) | |
tree | 65aaa997e99a5b5468053f8f3ca0eff0c81b5a0c /src/core/lib | |
parent | 86958768b462c5428cf6607508895d3a44cd3d16 (diff) |
Update tests
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/iomgr/buffer_pool.c | 19 | ||||
-rw-r--r-- | src/core/lib/iomgr/endpoint.c | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/buffer_pool.c b/src/core/lib/iomgr/buffer_pool.c index 0153bce203..78a98027f5 100644 --- a/src/core/lib/iomgr/buffer_pool.c +++ b/src/core/lib/iomgr/buffer_pool.c @@ -37,6 +37,7 @@ #include <grpc/support/alloc.h> #include <grpc/support/log.h> +#include <grpc/support/useful.h> #include "src/core/lib/iomgr/combiner.h" @@ -366,6 +367,10 @@ void grpc_buffer_pool_resize(grpc_buffer_pool *buffer_pool, size_t size) { grpc_exec_ctx_finish(&exec_ctx); } +/******************************************************************************* + * grpc_buffer_user channel args api + */ + grpc_buffer_pool *grpc_buffer_pool_from_channel_args( grpc_channel_args *channel_args) { for (size_t i = 0; i < channel_args->num_args; i++) { @@ -381,6 +386,20 @@ grpc_buffer_pool *grpc_buffer_pool_from_channel_args( return grpc_buffer_pool_create(); } +static void *bp_copy(void *bp) { + grpc_buffer_pool_ref(bp); + return bp; +} + +static void bp_destroy(void *bp) { grpc_buffer_pool_unref(bp); } + +static int bp_cmp(void *a, void *b) { return GPR_ICMP(a, b); } + +const grpc_arg_pointer_vtable *grpc_buffer_pool_arg_vtable(void) { + static const grpc_arg_pointer_vtable vtable = {bp_copy, bp_destroy, bp_cmp}; + return &vtable; +} + /******************************************************************************* * grpc_buffer_user api */ diff --git a/src/core/lib/iomgr/endpoint.c b/src/core/lib/iomgr/endpoint.c index f901fcf962..f3548a1d74 100644 --- a/src/core/lib/iomgr/endpoint.c +++ b/src/core/lib/iomgr/endpoint.c @@ -69,3 +69,7 @@ char* grpc_endpoint_get_peer(grpc_endpoint* ep) { grpc_workqueue* grpc_endpoint_get_workqueue(grpc_endpoint* ep) { return ep->vtable->get_workqueue(ep); } + +grpc_buffer_user* grpc_endpoint_get_buffer_user(grpc_endpoint* ep) { + return ep->vtable->get_buffer_user(ep); +} |