Motivation: There are cases where you want a buffer to be "constant." Buffers are inherently mutable, but it's possible to block off write access to the buffer contents. This doesn't make it completely safe to share the buffer across multiple threads, but it does catch most races that could occur. Modification: Add a method to Buf for toggling read-only mode. When a buffer is read-only, the write accessors throw exceptions when called. In the MemSegBuf, this is implemented by having separate read and write references to the underlying memory segment. In a read-only buffer, the write reference is redirected to point to a closed memory segment, thus preventing all writes to the memory backing the buffer. Result: It is now possible to make buffers read-only. Note, however, that it is also possible to toggle a read-only buffer back to writable. We need that in order for buffer pools to be able to fully reset the state of a buffer, regardless of the buffer implementation.
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 most 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
– remove the leftover containers created bydbg
,test
, andbuild
.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.
Description
Languages
Java
99.6%
Dockerfile
0.2%
Makefile
0.2%