492977d9be
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. |
||
---|---|---|
.. | ||
memseg | ||
Allocator.java | ||
AllocatorControl.java | ||
Buf.java | ||
BufAccessors.java | ||
BufHolder.java | ||
BufRef.java | ||
ByteCursor.java | ||
CleanerPooledDrop.java | ||
ComponentProcessor.java | ||
CompositeBuf.java | ||
Deref.java | ||
Drop.java | ||
ManagedAllocator.java | ||
MemoryManager.java | ||
Owned.java | ||
package-info.java | ||
Rc.java | ||
RcSupport.java | ||
ResourceDisposeFailedException.java | ||
Scope.java | ||
Send.java | ||
SizeClassedMemoryPool.java | ||
Statics.java | ||
TransferSend.java |