ByteAllocator provides chunk allocation of byte, amortizing the overhead of each allocation. Because the underlying storage for the slices is shared, they should share a similar lifetime in order to avoid pinning large amounts of memory unnecessarily. The allocator itself is a byte where cap() indicates the total amount of memory and len() is the amount already allocated. The size of the buffer to allocate from is grown exponentially when it runs out of room up to a maximum size (chunkAllocMaxSize).
Alloc allocates a new chunk of memory with the specified length. extraCap indicates additional zero bytes that will be present in the returned byte, but not part of the length.
Copy allocates a new chunk of memory, initializing it from src. extraCap indicates additional zero bytes that will be present in the returned byte, but not part of the length.