mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
4ce33ced0d
Our libcache implementation of swift::sys::Cache was broken for ref-counted values (which are used by e.g. the SourceKit ASTManager). It would always `retain(value)` in `set(key, value)`, but under the hood libcache shares values, so we would only get one `release(value)` if the same value was used across multiple keys, or if the same value *and* key were set multiple times. This was causing us to never release ASTs cached by SourceKit even when the underlying libcache purged itself under memory pressure. rdar://problem/21619189