Class UnixFSMemoryUtils
java.lang.Object
dev.getelements.elements.rt.transact.unix.UnixFSMemoryUtils
Some dirty hacks to support atomic memory access.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAtomicLong(ByteBuffer byteBuffer) Makes an instance ofUnixFSAtomicLongfrom for details.abstract UnixFSAtomicLonggetAtomicLong(ByteBuffer byteBuffer, int position) Gets aUnixFSAtomicLongwith the suppliedByteBuffer.static UnixFSMemoryUtilsGets the instance of theUnixFSMemoryUtilsbased on the system configuration.
-
Constructor Details
-
UnixFSMemoryUtils
public UnixFSMemoryUtils()
-
-
Method Details
-
getInstance
Gets the instance of theUnixFSMemoryUtilsbased on the system configuration.- Returns:
- the instance of
UnixFSMemoryUtils
-
getAtomicLong
Makes an instance ofUnixFSAtomicLongfrom for details. -
getAtomicLong
Gets aUnixFSAtomicLongwith the suppliedByteBuffer. The 64-bit counter object will be placed at theByteBuffer'sBuffer.position(). TheByteBuffer's position is unchanged. This presumes that theBuffer.position()is properly aligned for this type of atomic operation and if it is not, then undefined behavior may result.- Parameters:
byteBuffer- theByteBufferposition- the positing within theByteBuffer- Returns:
- the
UnixFSAtomicLong - Throws:
IllegalArgumentException- if this method can detect misalignment, or otherwise improper use
-