You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/05/16 17:33:00 UTC
[arrow-datafusion] branch master updated: Fix size_of_scalar test (#2531)
This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new 2eb87976c Fix size_of_scalar test (#2531)
2eb87976c is described below
commit 2eb87976cae16c571fc78f58a5ec69562df1c2a4
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Mon May 16 13:32:56 2022 -0400
Fix size_of_scalar test (#2531)
* Fix size_of_scalar test
* add comments
* Update tests
---
datafusion/core/src/scalar.rs | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/datafusion/core/src/scalar.rs b/datafusion/core/src/scalar.rs
index 774b8ebf8..ea8fe7ac8 100644
--- a/datafusion/core/src/scalar.rs
+++ b/datafusion/core/src/scalar.rs
@@ -374,11 +374,16 @@ mod tests {
// Since ScalarValues are used in a non trivial number of places,
// making it larger means significant more memory consumption
// per distinct value.
- #[cfg(target_arch = "aarch64")]
- assert_eq!(std::mem::size_of::<ScalarValue>(), 64);
+ //
+ // The alignment requirements differ across architectures and
+ // thus the size of the enum appears to as as well
- #[cfg(target_arch = "amd64")]
- assert_eq!(std::mem::size_of::<ScalarValue>(), 48);
+ let expected = match cfg!(target_arch = "aarch64") {
+ true => 64,
+ false => 48,
+ };
+
+ assert_eq!(std::mem::size_of::<ScalarValue>(), expected);
}
#[test]