commit | 1b970713d09a74350386f3fe4389ad4d09c13d0f | [log] [tgz] |
---|---|---|
author | Deleplace <deleplace@google.com> | Fri Nov 17 12:40:48 2023 +0100 |
committer | Michael Stapelberg <stapelberg@google.com> | Fri Jan 19 08:35:58 2024 +0000 |
tree | 53be69e940e3e1e53e19430d595f17a6b947bc8e | |
parent | db7319d0e0e361ccef5c449b760df8e5f2d5087c [diff] |
slices: zero the slice elements discarded by Delete, DeleteFunc, Compact, CompactFunc, Replace. Backport from stdlib: to avoid memory leaks in slices that contain pointers, clear the elements between the new length and the original length. Fixes golang/go#63393 Change-Id: I38bf64b27619d8067f2e95ce3c7952ec95ca55b8 Reviewed-on: https://go-review.googlesource.com/c/exp/+/543335 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Eli Bendersky <eliben@google.com>
This subrepository holds experimental and deprecated (in the old
directory) packages.
The idea for this subrepository originated as the pkg/exp
directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get
these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.