dgraph-io / ristretto

A high performance memory-bound Go cache
https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache/
Apache License 2.0
5.54k stars 364 forks source link

[Documentation]: Describe guarantees (or lack thereof) under aliased mutation of arguments and return values #381

Open varungandhi-src opened 2 months ago

varungandhi-src commented 2 months ago

What version of Ristretto is the target?

Latest

Documentation.

The docs for the Cache type don't say anything about the interaction of aliased mutations with Get/Set. Is it fair to assume the following: "It is NOT safe to modify the return value of Get or to modify the key or value that were passed to Set."

Or does the implementation do deep-copying?

Additional information.

No response