Commit Graph

3 Commits

Author SHA1 Message Date
Marc Rasi
af37b2cf5e fix ASAN in cache test 2019-07-18 15:48:41 -07:00
Marc Rasi
cd2556d07d fix memory leak in swift::sys::Cache
It fails to destroy a key in one case.
2019-07-09 11:14:48 -07:00
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