In this commit, we replace the option `LEAN_DEFERRED_FREE` with `LEAN_LAZY_RC`. The idea is to match the nomenclature used in the literature. See paper: https://dl.acm.org/citation.cfm?id=964019 The following slide deck summarizes the paper: http://www.hboehm.info/popl04/refcnt.pdf We also implement the very simple approach described on this paper where a `del(o)` just puts `o` in the "to free" list, and each allocation frees at most one object. As pointed out in the paper above lazy RC may prevent a lot of memory from being reclaimed. For now, I am keeping the new option disabled. That being said, the test `arith_eval_nat.lean` is 29% faster when using lazy RC, and beats the OCaml version. In the following paper https://www.microsoft.com/en-us/research/wp-content/uploads/2017/01/tm567-1.pdf a separate thread keeps processing the "to free" list. However, I think this approach is not compatible with our `object_memory_kind::STHeap` trick. Tomorrow, I will measure the space overhead when compiling the Lean corelib using Lazy RC using my linux desktop cc @kha |
||
|---|---|---|
| .. | ||
| boot | ||
| cmake | ||
| frontends/lean | ||
| init | ||
| kernel | ||
| library | ||
| runtime | ||
| shared | ||
| shell | ||
| tests | ||
| util | ||
| CMakeLists.txt | ||
| CTestConfig.cmake | ||
| CTestCustom.cmake.in | ||
| Doxyfile | ||
| githash.h.in | ||
| memcheck.supp | ||
| version.h.in | ||