tustvold commented on code in PR #4681:
URL: https://github.com/apache/arrow-rs/pull/4681#discussion_r1291220233


##########
arrow-data/src/data.rs:
##########
@@ -1589,10 +1611,13 @@ pub struct DataTypeLayout {
 }
 
 impl DataTypeLayout {
-    /// Describes a basic numeric array where each element has a fixed width
-    pub fn new_fixed_width(byte_width: usize) -> Self {
+    /// Describes a basic numeric array where each element has type `T`
+    pub fn new_fixed_width<T>() -> Self {
         Self {
-            buffers: vec![BufferSpec::FixedWidth { byte_width }],
+            buffers: vec![BufferSpec::FixedWidth {
+                byte_width: mem::size_of::<T>(),
+                alignment: mem::align_of::<T>(),

Review Comment:
   > Like why not just align everything to 256bits
   
   We do, Rust doesn't :smile: And at least until the allocator API is 
stabilised there is no way to over-align a `Vec`



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