diff --git a/grpc.def b/grpc.def index 5b2b679708a..5ef59ab9561 100644 --- a/grpc.def +++ b/grpc.def @@ -177,7 +177,9 @@ EXPORTS grpc_slice_buffer_move_into grpc_slice_buffer_trim_end grpc_slice_buffer_move_first + grpc_slice_buffer_move_first_into_buffer grpc_slice_buffer_take_first + grpc_slice_buffer_undo_take_first gpr_malloc gpr_free gpr_realloc diff --git a/src/core/lib/slice/slice_buffer.c b/src/core/lib/slice/slice_buffer.c index 84fa89684f0..b1bf0ceb230 100644 --- a/src/core/lib/slice/slice_buffer.c +++ b/src/core/lib/slice/slice_buffer.c @@ -51,7 +51,7 @@ static void maybe_embiggen(grpc_slice_buffer *sb) { sb->slices = sb->base_slices; } - /* How many far away from sb->base_slices is sb->slices pointer */ + /* How far away from sb->base_slices is sb->slices pointer */ size_t slice_offset = (size_t)(sb->slices - sb->base_slices); size_t slice_count = sb->count + slice_offset; @@ -168,7 +168,6 @@ void grpc_slice_buffer_addn(grpc_slice_buffer *sb, grpc_slice *s, size_t n) { } } -/* TODO (sreek) - Check where this is used and if this is still safe */ void grpc_slice_buffer_pop(grpc_slice_buffer *sb) { if (sb->count != 0) { size_t count = --sb->count; diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index 230682e72d9..d8d76cc1c53 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -215,7 +215,9 @@ grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import; grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import; grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import; grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import; +grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import; grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import; +grpc_slice_buffer_undo_take_first_type grpc_slice_buffer_undo_take_first_import; gpr_malloc_type gpr_malloc_import; gpr_free_type gpr_free_import; gpr_realloc_type gpr_realloc_import; @@ -504,7 +506,9 @@ void grpc_rb_load_imports(HMODULE library) { grpc_slice_buffer_move_into_import = (grpc_slice_buffer_move_into_type) GetProcAddress(library, "grpc_slice_buffer_move_into"); grpc_slice_buffer_trim_end_import = (grpc_slice_buffer_trim_end_type) GetProcAddress(library, "grpc_slice_buffer_trim_end"); grpc_slice_buffer_move_first_import = (grpc_slice_buffer_move_first_type) GetProcAddress(library, "grpc_slice_buffer_move_first"); + grpc_slice_buffer_move_first_into_buffer_import = (grpc_slice_buffer_move_first_into_buffer_type) GetProcAddress(library, "grpc_slice_buffer_move_first_into_buffer"); grpc_slice_buffer_take_first_import = (grpc_slice_buffer_take_first_type) GetProcAddress(library, "grpc_slice_buffer_take_first"); + grpc_slice_buffer_undo_take_first_import = (grpc_slice_buffer_undo_take_first_type) GetProcAddress(library, "grpc_slice_buffer_undo_take_first"); gpr_malloc_import = (gpr_malloc_type) GetProcAddress(library, "gpr_malloc"); gpr_free_import = (gpr_free_type) GetProcAddress(library, "gpr_free"); gpr_realloc_import = (gpr_realloc_type) GetProcAddress(library, "gpr_realloc"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 4c4f655b861..7a145be4470 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -596,9 +596,15 @@ extern grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import; typedef void(*grpc_slice_buffer_move_first_type)(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *dst); extern grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import; #define grpc_slice_buffer_move_first grpc_slice_buffer_move_first_import +typedef void(*grpc_slice_buffer_move_first_into_buffer_type)(grpc_slice_buffer *src, size_t n, void *dst); +extern grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import; +#define grpc_slice_buffer_move_first_into_buffer grpc_slice_buffer_move_first_into_buffer_import typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer *src); extern grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import; #define grpc_slice_buffer_take_first grpc_slice_buffer_take_first_import +typedef void(*grpc_slice_buffer_undo_take_first_type)(grpc_slice_buffer *src, grpc_slice slice); +extern grpc_slice_buffer_undo_take_first_type grpc_slice_buffer_undo_take_first_import; +#define grpc_slice_buffer_undo_take_first grpc_slice_buffer_undo_take_first_import typedef void *(*gpr_malloc_type)(size_t size); extern gpr_malloc_type gpr_malloc_import; #define gpr_malloc gpr_malloc_import