awnumar / memguard

Secure software enclave for storage of sensitive information in memory.
Apache License 2.0
2.49k stars 124 forks source link

Why does Buffer.Freeze & Buffer.Melt use RLock to protect mutation? #104

Closed justjake closed 4 years ago

justjake commented 4 years ago

See: https://github.com/awnumar/memguard/blob/843870774d02d62e39559a85f0c7f46720caf8d9/core/buffer.go#L109

Should this not require Lock() to avoid conflict with Melt()? What is the reasoning behind RLock()?

awnumar commented 4 years ago

Well spotted, thanks.