> Doing that would erase the whole benefit of allocating a static array in the first place (you really don't want to be allocating memory for every packet that comes through).
The benefit is dubious. Performance is unlikely to be important in a single-connection logger. My advice is to lean on the garbage collector. Allocate away.
Buffered channels are certainly more complex, but if you're never sharing memory, shouldn't hurt you.
The benefit is dubious. Performance is unlikely to be important in a single-connection logger. My advice is to lean on the garbage collector. Allocate away.
Buffered channels are certainly more complex, but if you're never sharing memory, shouldn't hurt you.