-
- Downloads
[SPARK-12181] Check Cached unaligned-access capability before using Unsafe
## What changes were proposed in this pull request? For MemoryMode.OFF_HEAP, Unsafe.getInt etc. are used with no restriction. However, the Oracle implementation uses these methods only if the class variable unaligned (commented as "Cached unaligned-access capability") is true, which seems to be calculated whether the architecture is i386, x86, amd64, or x86_64. I think we should perform similar check for the use of Unsafe. Reference: https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/internal/PlatformDependent0.java#L112 ## How was this patch tested? Unit test suite Author: tedyu <yuzhihong@gmail.com> Closes #11943 from tedyu/master.
Showing
- common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java 28 additions, 0 deletions...nsafe/src/main/java/org/apache/spark/unsafe/Platform.java
- core/src/main/scala/org/apache/spark/memory/MemoryManager.scala 3 additions, 0 deletions...rc/main/scala/org/apache/spark/memory/MemoryManager.scala
Please register or sign in to comment