b749106c0c
Motivation: There are use cases that involve accumulating data into a buffer, then carving out prefix slices and sending them off on their own journey for further processing. Modification: Add a Buf.bifurcate API, that split a buffer, and its ownership, in two. Internally, the API will inject and maintain an atomically reference counted Drop instance, so that the original memory segment is not released until all bifurcated parts are closed. This works particularly well for composite buffers, where only the buffer (if any) wherein the bifurcation point lands, will actually have its memory split. A composite buffer can otherwise just crack its buffer array in two. Result: We now have a safe way of breaking the single ownership of some memory into multiple parts, that can be sent and owned independently. |
||
---|---|---|
.github/workflows | ||
src | ||
.dockerignore | ||
.gitignore | ||
Dockerfile | ||
Makefile | ||
pom.xml | ||
README.md |
Netty Incubator Buffer API
This repository is incubating a new buffer API proposed for Netty 5.
Building and Testing
Short version: just run make
.
The project currently relies on snapshot versions of the Panama Foreign fork of OpenJDK.
This allows us to test out the must recent version of the jdk.incubator.foreign
APIs, but also make building and local development more involved.
To simplify things, we have a Docker based build, controlled via a Makefile with the following commands:
image
– build the docker image. This includes building a snapshot of OpenJDK, and download all relevant Maven dependencies.test
– run all tests in a docker container. This impliesimage
. The container is automatically deleted afterwards.dbg
– drop into a shell in the build container, without running the build itself. The debugging container is not deleted afterwards.clean
– remote the debugging container created bydbg
.build
– build binaries and run all tests in a container, and copy thetarget
directory out of the container afterwards. This is the default build target.