final long pointer = Native.malloc(size); if (pointer == 0) { throw new ODirectMemoryAllocationFailedException("Can not allocate direct memory chunk of size " + size); } else { if (!isLinux) { throw new ODirectMemoryAllocationFailedException("Alignment of pointers is allowed only on Linux platforms.");