Rich-T-kid commented on code in PR #10317:
URL: https://github.com/apache/arrow-rs/pull/10317#discussion_r3589590919


##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -129,24 +160,35 @@ impl MutableBuffer {
     /// then `isize::MAX`, then this function will panic.
     #[inline]
     pub fn with_capacity(capacity: usize) -> Self {
-        let capacity = bit_util::round_upto_multiple_of_64(capacity);
+        Self::try_with_capacity(capacity).unwrap_or_else(|e| panic!("{e}"))
+    }
+
+    /// Fallible version of [`MutableBuffer::with_capacity`].
+    #[inline]
+    pub fn try_with_capacity(capacity: usize) -> Result<Self, 
MutableBufferError> {
+        let capacity = capacity
+            .checked_next_multiple_of(64)

Review Comment:
   created a follow up ticket : https://github.com/apache/arrow-rs/issues/10350



-- 
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]

Reply via email to