rclone/backend/crypt
albertony 9172c9b3dd crypt: reduce allocations
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
2023-03-26 14:28:15 +02:00
..
pkcs7 Error strings should not be capitalized 2022-06-23 23:26:02 +02:00
cipher.go crypt: reduce allocations 2023-03-26 14:28:15 +02:00
cipher_test.go crypt: reduce allocations 2023-03-26 14:28:15 +02:00
crypt.go backend: fix typos found by codespell 2023-03-24 11:34:14 +00:00
crypt_internal_test.go test: replace defer cleanup with t.Cleanup 2022-12-09 14:38:05 +00:00
crypt_test.go backend: allow wrapping backend tests to run in make quicktest 2022-06-29 17:30:37 +01:00