mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
`VarInt` can get large enough to exhaust available memory on many machines. Instead of allocating directly, check the size of the allocation against some limit. The limit chosen for frames is 128 KiB, which is roughly twice as much as actual gossip and Git protocol frames are expected to be. However, 128 KiB is arguably short enough to not burden a standard consumer machine too much.