mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-20 00:00:08 +02:00
The previous implementation would always use the capacity of the previous buffer, which would effectively prevent it from ever shrinking. This also means that protocol with greater variance in possible frame sizes would likely be heavily over-allocating. If these implementations use zero-copy, this would imply that even small frames kept alive by the client would use large amounts of memory. The change is motivated by the implementation of the cassandra-protocol, which allows frames of up to 256MB in size, which solely depend on the kind of query.