netty5/buffer/src
Rolandz 836c39b82f Fix offset calculation in PooledByteBufAllocator when used
Motivation:

When we create new chunk with memory aligned, the offset of direct memory should be
'alignment - address & (alignment - 1)', not just 'address & (alignment - 1)'.

Modification:

Change offset calculating formula to offset = alignment - address & (alignment - 1) in PoolArena.DirectArena#offsetCacheLine and add a unit test to assert that.

Result:

Correctly calculate offset.
2018-11-27 11:47:40 +01:00
..
main/java/io/netty/buffer Fix offset calculation in PooledByteBufAllocator when used 2018-11-27 11:47:40 +01:00
test/java/io/netty/buffer Fix offset calculation in PooledByteBufAllocator when used 2018-11-27 11:47:40 +01:00