Github user samelamin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17472#discussion_r108879329
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java 
---
    @@ -46,18 +46,22 @@
       private static final boolean unaligned;
       static {
         boolean _unaligned;
    -    // use reflection to access unaligned field
    -    try {
    -      Class<?> bitsClass =
    -        Class.forName("java.nio.Bits", false, 
ClassLoader.getSystemClassLoader());
    -      Method unalignedMethod = bitsClass.getDeclaredMethod("unaligned");
    -      unalignedMethod.setAccessible(true);
    -      _unaligned = Boolean.TRUE.equals(unalignedMethod.invoke(null));
    -    } catch (Throwable t) {
    -      // 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|aarch64)$");
    +    String arch = System.getProperty("os.arch", "");
    +    if (arch.matches("^(ppc64le | ppc64)$")) {
    --- End diff --
    
    thats fine but itll end up being arch.startsWith("ppc64") || 
arch.startsWith("ppc64le")
    
    I thought this was less code, but startsWith is more readable
    
    Are you happy with that approach? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to