kpumuk commented on code in PR #3641:
URL: https://github.com/apache/thrift/pull/3641#discussion_r3611192549
##########
lib/rb/ext/memory_buffer.c:
##########
@@ -126,6 +126,11 @@ VALUE rb_thrift_memory_buffer_read_into_buffer(VALUE self,
VALUE buffer_value, V
int index;
VALUE buf = GET_BUF(self);
+ if (size > 0) {
+ Check_Type(buffer_value, T_STRING);
+ rb_str_modify(buffer_value);
+ }
Review Comment:
The mismatch is real, although the native method does not persist its local
index to `@index` until the loop completes, so this path does not drop input as
described. With a one-byte mutable destination and a two-byte read, native
writes the first byte, raises, and reports two bytes still available; pure Ruby
writes the first byte, raises, and reports one byte available. I’ll address
that pre-existing parity issue separately so this PR remains focused on frozen
destinations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]