Files
swift-mirror/include/swift/Basic/Cache.h
Ben Langmuir 4ce33ced0d Fix sys::Cache for ref-counted values which caused memory leaks in SourceKit
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
2017-07-06 13:56:58 -07:00

7.4 KiB