alamb commented on code in PR #6817:
URL: https://github.com/apache/arrow-rs/pull/6817#discussion_r1864867662


##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -468,7 +468,7 @@ impl MutableBuffer {
 }
 
 #[inline]
-fn dangling_ptr() -> NonNull<u8> {
+pub(crate) fn dangling_ptr() -> NonNull<u8> {
     // SAFETY: ALIGNMENT is a non-zero usize which is then casted
     // to a *mut T. Therefore, `ptr` is not null and the conditions for

Review Comment:
   Not introduced in this PR, but this function isn't generic, so I am not sure 
what `*mut T` is talking about



##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -468,7 +468,7 @@ impl MutableBuffer {
 }
 
 #[inline]
-fn dangling_ptr() -> NonNull<u8> {
+pub(crate) fn dangling_ptr() -> NonNull<u8> {

Review Comment:
   I suggest adding some some comments about this function given its name.
   
   Specifically, that it returns a valid, u8 pointer that is valid for the 
entire life of the process. Suitable for allocations of 0 length. 
   
   I realize it wasn't introduced in this PR, but the name is confusing to me 
-- Maybe calling it `arbtrary_ptr()` or something would be less confusing 🤔 



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