Commit Graph

8 Commits

Author SHA1 Message Date
Chris Vest
35b1d4a4fe
Merge pull request #62 from netty/hide-refcounts
Hide Rc.countBorrows
2021-05-10 10:25:13 +02:00
Chris Vest
9db454ffe5 Fix composite buffer send bug
Fix a bug in CompositeBuffer.send, where the received buffer would not have ownership.
The fix is to avoid incrementing the reference count in the composite buffer constructor call used in the transferOwnership function.
2021-05-07 12:02:55 +02:00
Chris Vest
1eece080af Fix up tests that relied on the borrow count 2021-05-07 11:31:46 +02:00
Chris Vest
599c01b762 Make the buffer read-only state irreversible
This greatly simplifies the semantics around the const buffers.
When they can no longer be made writable, there is no longer any need for "deconstification".

I decided to call the method "makeReadOnly" to distinguish it from "asReadOnly" that is seen in ByteBuf and ByteBuffer. The latter two return read-only _views_ of the buffer, while makeReadOnly changes the state of the buffer in-place.
2021-05-05 12:30:52 +02:00
Chris Vest
66c2bf4e2c Rename bifurcate to split 2021-04-29 15:34:04 +02:00
Chris Vest
2f12455fa9 Make CompositeBuffer part of the public API
And move the composite buffer related methods to it.
2021-04-27 16:11:30 +02:00
Chris Vest
7775460984 Make bifurcate and ensureWritable more flexible
This supports more use cases.
The ensureWritable method can now amortise its allocation cost by allocating more than what is strictly necessary to satisfy the immediate call.
The bifurcate method can now split at a given offset.
2021-04-27 10:00:27 +02:00
Chris Vest
fdc59cc43c Break up the monolithic BufferTest into multiple test classes
Then run those tests in independent surefire forks.
This should allow Maven to hold on to less test metadata, and cope better with the large number of tests.
2021-04-14 11:44:58 +02:00