Aligned long views over byte arrays and heap ByteBuffers

John Rose john.r.rose at oracle.com
Mon Jan 18 18:08:08 UTC 2016


> On Jan 18, 2016, at 6:17 AM, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
> 
> That being said, there probably are VMs


Such exotic VMs (for tiny platforms, perhaps) can throw appropriate UOEs. 

Most widespread 32-bit system ABIs align long variables. We can expect nearly all JVMs to loosely follow ABI practices. 

If you don't like the UOEs and want bullet proof GC-able buffers, simply use long arrays. 

Later, we will get into odd territory if we introduce jumbo alignments for fast vector work. (E.g. AlignedLong4[] or Aligned<Long4>[] or even Aligned<256,Long4>[].) Such arrays will need special GC processing to enforce alignment, and byte arrays will probably never be conformable to such requirements. We may want to have a factory method for building maximally aligned buffers.

– John



More information about the valhalla-dev mailing list