mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
The safemem.Reader interface receiver was causing the implementation to escape to heap (as at compile time, the compiler can not prove anything about the implementation). Using generics for io.ReadFullToBlocks() does not help in avoiding the heap allocation. With this change, we avoid at least these allocations: - rw variable in kcov.Kcov.TaskWork(). - safemem.BlockSeqReader struct in in mm.MemoryManager.getPMAsInternalLocked(). - gr variable in fsutil.FileRangeSet.Fill(). - h variable in gofer.dentry.Translate(). - h variable in gofer.dentryReadWriter.ReadToBlocks(). Some of these are on hot paths for IO workloads. PiperOrigin-RevId: 609805848