mirror of https://github.com/golang/go.git
add comments
Change-Id: I2e9cea8d39c1d1e9df9ef7e8172060400b596dae
This commit is contained in:
parent
38d219b81f
commit
38f1d6c19d
|
|
@ -112,6 +112,7 @@ func LastIndexRabinKarp[T string | []byte](s, sep T) int {
|
|||
}
|
||||
|
||||
// MakeNoZero makes a slice of length n and capacity of at least n Bytes
|
||||
// without zeroing the bytes. It is the caller's responsibility to
|
||||
// ensure uninitialized bytes do not leak to the end user.
|
||||
// without zeroing the bytes (including the bytes between len and cap).
|
||||
// It is the caller's responsibility to ensure uninitialized bytes
|
||||
// do not leak to the end user.
|
||||
func MakeNoZero(n int) []byte
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ import (
|
|||
// Do not copy a non-zero Builder.
|
||||
type Builder struct {
|
||||
addr *Builder // of receiver, to detect copies by value
|
||||
buf []byte
|
||||
|
||||
// External users should never get direct access to this buffer, since
|
||||
// the slice at some point will be converted to a string using unsafe, also
|
||||
// data between len(buf) and cap(buf) might be uninitialized.
|
||||
buf []byte
|
||||
}
|
||||
|
||||
// noescape hides a pointer from escape analysis. It is the identity function
|
||||
|
|
|
|||
Loading…
Reference in New Issue