From 083de00cb608a7414aae99a639825482bebfea8a Mon Sep 17 00:00:00 2001 From: Richael Date: Mon, 22 Aug 2016 09:01:50 +0100 Subject: [SPARK-17127] Make unaligned access in unsafe available for AArch64 ## # What changes were proposed in this pull request? From the spark of version 2.0.0 , when MemoryMode.OFF_HEAP is set , whether the architecture supports unaligned access or not is checked. If the check doesn't pass, exception is raised. We know that AArch64 also supports unaligned access , but now only i386, x86, amd64, and X86_64 are included. I think we should include aarch64 when performing the check. ## How was this patch tested? Unit test suite Author: Richael Closes #14700 from yimuxi/zym_change_unsafe. --- common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java b/common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java index a2ee45c37e..c892b9cdaf 100644 --- a/common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java +++ b/common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java @@ -55,7 +55,7 @@ public final class Platform { // We at least know x86 and x64 support unaligned access. String arch = System.getProperty("os.arch", ""); //noinspection DynamicRegexReplaceableByCompiledPattern - _unaligned = arch.matches("^(i[3-6]86|x86(_64)?|x64|amd64)$"); + _unaligned = arch.matches("^(i[3-6]86|x86(_64)?|x64|amd64|aarch64)$"); } unaligned = _unaligned; } -- cgit v1.2.3