Commit Graph

10 Commits

Author SHA1 Message Date
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
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
31ff35e1dd Use 80 column headers consistently. 2016-01-04 01:35:02 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
cd7d8dfaff Fix alignment as requested by @gribozavr in #692 2015-12-21 08:54:24 +01:00
practicalswift
176f487d76 Fix incorrect filenames in headers. 2015-12-20 23:59:05 +01:00
Argyrios Kyrtzidis
49a5f53e19 [libBasic] Introduce a caching mechanism, that evicts its entries when there is memory pressure.
The underlying mechanism uses darwin's libcache library (if not building on darwin there is a default implementation).

This was originally introduced in SourceKit, but we are moving it to libswiftBasic so it can be utilized by libswiftIDE
for caching code-completion results.

Swift SVN r9610
2013-10-23 00:41:55 +00:00