Implementation of array of long using {@link com.alexkasko.unsafe.offheap.OffHeapMemory}.
Default implementation uses {@code sun.misc.Unsafe}, with all operations guarded with {@code assert} keyword.With assertions enabled in runtime ( {@code -ea} java switch) {@link AssertionError}will be thrown on illegal index access. Without assertions illegal index will crash JVM.
Array won't be zeroed after creation (will contain garbage by default). Allocated memory may be freed manually using {@link #free()} (thread-safeand may be called multiple times) or it will be freed after {@link OffHeapLongArray}will be garbage collected.
Note: while class implements Iterable, iterator will create new autoboxed Long object on every {@code next()} call, this behaviour is inevitable with iterators in java 6/7. @author alexkaskoDate: 2/22/13
|
|
|
|