tokio-rs / bytes

Utilities for working with bytes
MIT License
1.87k stars 278 forks source link

Align BytesMut to page boundary (4096 bytes) #607

Open pkolaczk opened 1 year ago

pkolaczk commented 1 year ago

Is there a way to align BytesMut to page boundary? My app uses buffers that are a multiplicity of 4 KiB. I guess that might help with fragmentation. The default allocator doesn't seem to align them.

Darksonn commented 1 year ago

No, see #601.

JackKelly commented 5 months ago

PR #684 illustrates one way in which it might be possible to create a Bytes with arbitrary alignment.