diff options
| author | Johannes Hostert <jhostert@ethz.ch> | 2024-08-23 22:22:20 +0200 |
|---|---|---|
| committer | Johannes Hostert <jhostert@ethz.ch> | 2024-08-27 20:26:02 +0200 |
| commit | e26779e784cf36e0dc48add24ca961255f4d8a76 (patch) | |
| tree | 4f54773a78158fff2c1a4968f0b24abcd166ee9e /compiler/rustc_interface/src/errors.rs | |
| parent | 4318bfe611b34fa36a209661b8c76e5d3b42857f (diff) | |
| download | rust-e26779e784cf36e0dc48add24ca961255f4d8a76.tar.gz rust-e26779e784cf36e0dc48add24ca961255f4d8a76.zip | |
Make Tree Borrows Provenance GC compact the tree
Follow-up on #3833 and #3835. In these PRs, the TB GC was fixed to no longer cause a stack overflow. One test that motivated it was the test `fill::horizontal_line` in `tiny_skia`. But not causing stack overflows was not a large improvents, since it did not fix the fundamental issue: The tree was too large. The test now ran, but it required gigabytes of memory and hours of time, whereas it finishes within seconds in Stacked Borrows. The problem in that test was that it used [`slice::chunked`](https://doc.rust-lang.org/std/primitive.slice.html#method.chunks) to iterate a slice in chunks. That iterator is written to reborrow at each call to `next`, which creates a linear tree with a bunch of intermediary nodes, which also fragments the `RangeMap` for that allocation. The solution is to now compact the tree, so that these interior nodes are removed. Care is taken to not remove nodes that are protected, or that otherwise restrict their children.
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
