On Thu, Feb 4, 2021 at 10:32 PM Steve Roth wrote:
>
> How can I implement a writeByte function, against an unknown io.Writer
> implementation, that doesn't allocate heap memory?
>
The only way I'm aware of achieving this is proving to the compiler that
buf is safe to be kept by w by moving buf t
On Fri, Feb 5, 2021 at 12:32 PM Steve Roth wrote:
>
> How can I implement a writeByte function, against an unknown io.Writer
> implementation, that doesn't allocate heap memory?
>
>
As you've correctly stated, because the call to .Write() is via an
interface the compiler can't tell whether any pa
Hi, folks,
I could use some assistance getting rid of some unnecessary heap
allocations. I have code that needs to write individual bytes to an
io.Writer. (The Writer implementation given to my code is probably
buffered, but my code shouldn't rely on a particular concrete type.) The
relevant par