Skip to content
Snippets Groups Projects
  • Carl Lerche's avatar
    933b8b26
    `BytesMut::reserve` should avoid small allocations · 933b8b26
    Carl Lerche authored
    This change tracks the original capacity requested when `BytesMut` is
    first created. This capacity is used when a `reserve` needs to allocate
    due to the current view being too small. The newly allocated buffer will
    be sized the same as the original allocation.
    933b8b26
    History
    `BytesMut::reserve` should avoid small allocations
    Carl Lerche authored
    This change tracks the original capacity requested when `BytesMut` is
    first created. This capacity is used when a `reserve` needs to allocate
    due to the current view being too small. The newly allocated buffer will
    be sized the same as the original allocation.