Motivation: Future versions of Java will introduce a new API for working with off-heap and on-heap memory alike. This API _could_ potentially relieve us of many of our use cases for Unsafe. We wish to explore how suitable these APIs are for this task. Modification: Add an entirely separate version of the Netty ByteBuf API, implemented in terms of MemorySegment. No existing code is changed at this time. The current prototype is only to prove the concept, and does not aim to be a full replacement. Result: We are able to build a fairly nice API, but with caveats. Restrictions in the current (JDK 16 EA) MemorySegment API, around how ownership is transferred between threads, means we are currently still relying on Unsafe. While our use of Unsafe could be reduced, it can not be eliminated in our ByteBuf API, because we are relying on it to work around the current ownership restrictions. I believe it is _possible_ to create a safe ownership transfer API at the JDK level, so hopefully this restriction can be lifted in the future.
Netty Incubator Buffer API
This repository is incubating a new buffer API proposed for Netty 5.
Description
Languages
Java
99.6%
Dockerfile
0.2%
Makefile
0.2%