We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues 337
The text was updated successfully, but these errors were encountered:
// Unmarshal decodes an interleaved frame. func (f *InterleavedFrame) Unmarshal(br *bufio.Reader) error { var header [4]byte _, err := io.ReadFull(br, header[:]) if err != nil { return err } if header[0] != InterleavedFrameMagicByte { return fmt.Errorf("invalid magic byte (0x%.2x)", header[0]) } // it's useless to check payloadLen since it's limited to 65535 payloadLen := int(uint16(header[2])<<8 | uint16(header[3])) f.Channel = int(header[1]) f.Payload = make([]byte, payloadLen) _, err = io.ReadFull(br, f.Payload) return err }
Discuss, how to use this method not to request memory make([]byte, payloadLen) This increases the pressure on the GC
make([]byte, payloadLen)
GC
Sorry, something went wrong.
this is not a memory leak but a possible improvement, that is the ability to reuse buffers instead of allocating new ones.
Successfully merging a pull request may close this issue.
issues 337
The text was updated successfully, but these errors were encountered: