@Override
    public LongArray allocate(int length) {
        assert (length < Integer.MAX_VALUE / 2) : "Length " + length + " is too large";
        // This is used as temporary buffer, it's fine to allocate from JVM heap.
        return new LongArray(MemoryBlock.fromLongArray(new long[length * 2]));
    }
Supports sorting an array of (record pointer, key prefix) pairs.
Used in {@link UnsafeInMemorySorter}.

Within each long[] buffer, position {@code 2 * i} holds a pointer pointer to the record at
index {@code i}, while position {@code 2 * i + 1} in the array holds an 8-byte key prefix.
indexr-query-opt/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSortDataFormat.java