Jefffrey commented on code in PR #10932:
URL: https://github.com/apache/arrow-rs/pull/10932#discussion_r3911234407
##########
arrow-buffer/src/buffer/immutable.rs:
##########
@@ -224,17 +224,16 @@ impl Buffer {
if desired_capacity < self.capacity()
&& let Some(bytes) = Arc::get_mut(&mut self.data)
{
- if bytes.try_realloc(desired_capacity).is_ok() {
- // Realloc complete - update our pointer into `bytes`:
- self.ptr = if is_empty {
- bytes.as_ptr()
- } else {
- // SAFETY: we kept all elements leading up to the offset
- unsafe { bytes.as_ptr().add(offset) }
- }
- } else {
- // Failure to reallocate is fine; we just failed to free up
memory.
Review Comment:
would be nice to keep this comment about failure
--
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]