diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-06 14:43:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-06 14:43:37 +0100 |
commit | 7d39b13996e312a8a738ed0dfccab45978fc42f8 (patch) | |
tree | 91761b9bf78d9015fbb6083b9245eb9f6133e234 /crates/hir_def/src/path.rs | |
parent | 12e86433ab57ee8b1c96b8da0480fd311752487b (diff) | |
parent | 4e2a6ac7eae3ff193962421cc3c86e5d8f9a7e31 (diff) |
Merge #8364
8364: Memory usage improvements r=jonas-schievink a=alexmaco
These are mostly focused on splitting up enum variants with large size differences between variants by `Box`-ing things up.
In my testing this reduces the memory usage somewhere in the low percentages, even though the measurements are quite noisy.
Co-authored-by: Alexandru Macovei <[email protected]>
Diffstat (limited to 'crates/hir_def/src/path.rs')
-rw-r--r-- | crates/hir_def/src/path.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_def/src/path.rs b/crates/hir_def/src/path.rs index f9c8328f0..b528ff8ba 100644 --- a/crates/hir_def/src/path.rs +++ b/crates/hir_def/src/path.rs | |||
@@ -289,6 +289,12 @@ impl From<Name> for Path { | |||
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | impl From<Name> for Box<Path> { | ||
293 | fn from(name: Name) -> Box<Path> { | ||
294 | Box::new(Path::from(name)) | ||
295 | } | ||
296 | } | ||
297 | |||
292 | impl From<Name> for ModPath { | 298 | impl From<Name> for ModPath { |
293 | fn from(name: Name) -> ModPath { | 299 | fn from(name: Name) -> ModPath { |
294 | ModPath::from_segments(PathKind::Plain, iter::once(name)) | 300 | ModPath::from_segments(PathKind::Plain, iter::once(name)) |