1039f69e53
Motivation This is a "simpler" alternative to #9416 which fixes the same CompositeByteBuf bugs described there, originally reported by @jingene in #9398. Modifications - Add fields to Component class for the original buffer along with its adjustment, which may be different to the already-stored unwrapped buffer. Use it in appropriate places to ensure correctness and equivalent behaviour to that prior to the earlier optimizations - Add comments explaining purpose of each of the Component fields - Unwrap more kinds of buffers in newComponent method to extend scope of the existing indirection-reduction optimization - De-duplicate common buffer consolidation logic - Unit test for the original bug provided by @jingene Result - Correct behaviour / fixed bugs - Some code deduplication / simplification - Unwrapping optimization applied to more types of buffers The downside is increased mem footprint from the two new fields, and additional allocations in some specific cases, though those should be rare. Co-authored-by: jingene <jingene0206@gmail.com> |
||
---|---|---|
.. | ||
main | ||
test/java/io/netty/buffer |