mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +00:00
all: Go 1.21 support
This commit is contained in:
committed by
Ron Evans
parent
c25dd0a972
commit
a93f0ed12a
@@ -251,3 +251,13 @@ func IndexRabinKarp(s, substr string) int {
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
// MakeNoZero makes a slice of length and capacity n without zeroing the bytes.
|
||||
// It is the caller's responsibility to ensure uninitialized bytes
|
||||
// do not leak to the end user.
|
||||
func MakeNoZero(n int) []byte {
|
||||
// Note: this does zero the buffer even though that's not necessary.
|
||||
// For performance reasons we might want to change this (similar to the
|
||||
// malloc function implemented in the runtime).
|
||||
return make([]byte, n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user