mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:46:24 +08:00
9172c9b3dd
This changes crypt's use of sync.Pool: Instead of storing slices it now stores pointers pointers fixed sized arrays. This issue was reported by staticcheck: SA6002 - Storing non-pointer values in sync.Pool allocates memory A sync.Pool is used to avoid unnecessary allocations and reduce the amount of work the garbage collector has to do. When passing a value that is not a pointer to a function that accepts an interface, the value needs to be placed on the heap, which means an additional allocation. Slices are a common thing to put in sync.Pools, and they're structs with 3 fields (length, capacity, and a pointer to an array). In order to avoid the extra allocation, one should store a pointer to the slice instead. See: https://staticcheck.io/docs/checks#SA6002 |
||
---|---|---|
.. | ||
pkcs7 | ||
cipher_test.go | ||
cipher.go | ||
crypt_internal_test.go | ||
crypt_test.go | ||
crypt.go |