You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tun, conn, device: allocate buffers in the I/O devices
Previously crypto device maintained a batch of preallocated
to the MaxMessageSize buffers that the I/O only needs to
read into.
This change inverts the buffer ownership. A (wrapped) nil
pointer is passed into I/O. Device expects a backing
array to be allocated, and a slice of read data cut to
offset+size returned from the read within the same wrapper.
The wrapper is defined in buffer.Buffer, and carries
the backing reference and an optional Recycler implementation
to return the backing for reuse.
I/O is encouraged to implement a buffer management solution
that works best for its host OS. A shared sync.Pool is
provided as a default option.
Updates tailscale/corp#36989
Signed-off-by: Alex Valiushko <alexvaliushko@tailscale.com>
Change-Id: I58908d9d3fd09441e9378a74b0ee19136a6a6964
0 commit comments