netty-incubator-buffer-api/src/main/java/io/netty/buffer/api
Chris Vest 492977d9be Introduce Deref abstraction
Motivation:
Sometimes, we wish to operate on both buffers and anything that can produce a buffer.
For instance, when making a composite buffer, we could compose either buffers or sends.

Modification:
Introduce a Deref interface, which is extended by both Rc and Send.
A Deref can be used to acquire an Rc instance, and in doing so will also acquire a reference to the Rc.
That is, dereferencing increases the reference count.
For Rc itself, this just delegates to Rc.acquire, while for Send it delegates to Send.receive, and can only be called once.
The Allocator.compose method has been changed to take Derefs.
This allows us to compose either Bufs or Sends of bufs.
Or a mix.
Extra care and caution has been added to the code, to make sure the reference counts are managed correctly when composing buffers, now that it's a more complicated operation.
A handful of convenience methods for working with Sends have also been added to the Send interface.

Result:
We can now build a composite buffer out of sends of buffers.
2021-02-11 14:26:57 +01:00
..
memseg Update examples 2021-01-25 13:23:26 +01:00
Allocator.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
AllocatorControl.java Add a Buf.bifurcate method 2020-12-10 10:29:31 +01:00
Buf.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
BufAccessors.java Javadoc corrections for buffer accessor methods 2021-01-05 12:24:46 +01:00
BufHolder.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
BufRef.java Make BufHolder protected methods final if they're not meant to be overwritten 2020-12-16 17:06:22 +01:00
ByteCursor.java Update ByteCursor method names and related javadocs 2020-12-09 11:03:30 +01:00
CleanerPooledDrop.java Buffers always have a cleaner attached 2020-12-17 16:13:43 +01:00
ComponentProcessor.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
CompositeBuf.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
Deref.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
Drop.java Address review comments on bifurcate PR 2020-12-10 12:51:18 +01:00
ManagedAllocator.java Remove thread-confinement of Buffers 2020-12-30 15:42:33 +01:00
MemoryManager.java Move the MemorySegment based Buf implementation to its own package, and break the remaining bits of tight coupling. 2020-11-17 15:53:40 +01:00
Owned.java Rename the 'b2' package to 'api' 2020-11-17 15:40:13 +01:00
package-info.java Add a docker-based build 2020-11-18 17:16:37 +01:00
Rc.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
RcSupport.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
ResourceDisposeFailedException.java Rename the 'b2' package to 'api' 2020-11-17 15:40:13 +01:00
Scope.java Add BufHolder and BufRef helper classes 2020-12-14 14:22:37 +01:00
Send.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
SizeClassedMemoryPool.java Add support for read-only buffers 2021-01-05 16:53:21 +01:00
Statics.java Move the MemorySegment based Buf implementation to its own package, and break the remaining bits of tight coupling. 2020-11-17 15:53:40 +01:00
TransferSend.java Introduce Deref abstraction 2021-02-11 14:26:57 +01:00