mbutrovich commented on code in PR #12141:
URL: https://github.com/apache/arrow-rs/pull/12141#discussion_r4789981614


##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -927,23 +928,23 @@ impl MutableBuffer {
     }
 }
 
-/// Creates a non-null pointer with alignment of [`ALIGNMENT`]
-///
-/// This is similar to [`NonNull::dangling`]
+#[repr(align(256))]
+struct ZeroSizeArea {
+    _data: [u8; 1],
+}

Review Comment:
   Could we add a comment on why `_data` has one element? The struct is called 
`ZeroSizeArea`, so a later cleanup could reasonably shrink it to `[u8; 0]` or a 
unit struct. The one byte is what gives the static storage of its own, which is 
the point of this change. The new test compares addresses only, so it would 
still pass after that cleanup.
   
   ```suggestion
   struct ZeroSizeArea {
       // One byte so that the static has storage of its own, see 
`ZERO_SIZE_AREA`
       _data: [u8; 1],
   }
   ```



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