Source File
util.go
Belonging Package
github.com/pion/srtp/v3
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage srtpimport ()// growBufferSize grows the buffer size to the given number of bytes.func growBufferSize( []byte, int) []byte {if <= cap() {return [:]}:= make([]byte, )copy(, )return}// isSameBuffer returns true if slices a and b share the same underlying buffer.func isSameBuffer(, []byte) bool {// If both are nil, they are technically the same (no buffer)if == nil && == nil {return true}// If either is nil, or both have 0 capacity, they can't share backing bufferif cap() == 0 || cap() == 0 {return false}// Create a slice of length 1 from each if possible:= unsafe.Pointer(&[:1][0]) // nolint:gosec:= unsafe.Pointer(&[:1][0]) // nolint:gosecreturn ==}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |