You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/05/01 07:25:32 UTC

[GitHub] [arrow] sunchao commented on a change in pull request #6898: ARROW-8399: [Rust] Extend memory alignments to include other architectures

sunchao commented on a change in pull request #6898:
URL: https://github.com/apache/arrow/pull/6898#discussion_r418443106



##########
File path: rust/arrow/src/memory.rs
##########
@@ -21,7 +21,58 @@
 use std::alloc::Layout;
 use std::mem::align_of;
 
-pub const ALIGNMENT: usize = 64;
+#[cfg(target_arch = "x86")]
+pub const ALIGNMENT: usize = (1 << 6);
+
+#[cfg(target_arch = "x86_64")]
+pub const ALIGNMENT: usize = (1 << 7);
+
+#[cfg(target_arch = "mips")]
+pub const ALIGNMENT: usize = (1 << 5);
+
+#[cfg(target_arch = "mips64")]
+pub const ALIGNMENT: usize = (1 << 5);
+
+#[cfg(target_arch = "powerpc")]
+pub const ALIGNMENT: usize = (1 << 5);
+
+#[cfg(target_arch = "powerpc64")]
+pub const ALIGNMENT: usize = (1 << 6);
+
+#[cfg(target_arch = "riscv")]
+pub const ALIGNMENT: usize = (1 << 6);
+
+#[cfg(target_arch = "s390x")]
+pub const ALIGNMENT: usize = (1 << 8);
+
+#[cfg(target_arch = "sparc")]
+pub const ALIGNMENT: usize = (1 << 5);
+
+#[cfg(target_arch = "sparc64")]
+pub const ALIGNMENT: usize = (1 << 6);
+
+#[cfg(target_arch = "thumbv6")]
+pub const ALIGNMENT: usize = (1 << 5);
+
+#[cfg(target_arch = "thumbv7")]
+pub const ALIGNMENT: usize = (1 << 5);
+
+#[cfg(target_arch = "wasm32")]
+pub const ALIGNMENT: usize = FALLBACK_ALIGNMENT;

Review comment:
       nit: why we need this `FALLBACK_ALIGNMENT` here? 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org