diff options
author | David Garcia Quintas <dgq@google.com> | 2015-06-01 21:08:59 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-06-01 21:20:47 -0700 |
commit | 30bd4eb5cc268c0faa7a7b89f7be0af61598785f (patch) | |
tree | 245115eb3876511220c4cb8ebdce465ea90a085e /src/core | |
parent | 1b932e77f0b6f99556df03e5147f243d3bce0277 (diff) |
Removed grpc_byte_buffer_reader_{create,destroy}.
Introduced grpc_byte_buffer_init instead. It's now the user's responsibility to
manage memory.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/surface/byte_buffer_reader.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/surface/byte_buffer_reader.c b/src/core/surface/byte_buffer_reader.c index fd5289bac3..5d97609aaa 100644 --- a/src/core/surface/byte_buffer_reader.c +++ b/src/core/surface/byte_buffer_reader.c @@ -39,15 +39,13 @@ #include <grpc/support/slice_buffer.h> #include <grpc/byte_buffer.h> -grpc_byte_buffer_reader *grpc_byte_buffer_reader_create( - grpc_byte_buffer *buffer) { - grpc_byte_buffer_reader *reader = malloc(sizeof(grpc_byte_buffer_reader)); +void grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader, + grpc_byte_buffer *buffer) { reader->buffer = buffer; switch (buffer->type) { case GRPC_BB_SLICE_BUFFER: reader->current.index = 0; } - return reader; } int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader, @@ -68,7 +66,3 @@ int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader, } return 0; } - -void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) { - free(reader); -} |