diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-03-09 00:18:58 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-03-19 07:28:18 +0200 |
| commit | c04d4846f2a7a49e592f4e98f3e604851d600d4e (patch) | |
| tree | f3ec43f7507bac6981f0278cd027cc71fc85f165 /src/libsyntax/util | |
| parent | 87e72c38122cbd24199365232217ca8c15ebe995 (diff) | |
| download | rust-c04d4846f2a7a49e592f4e98f3e604851d600d4e.tar.gz rust-c04d4846f2a7a49e592f4e98f3e604851d600d4e.zip | |
Discard MTWT & interner tables from TLD after they stop being useful.
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/interner.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 969c7cec87c..c1ed96fe4de 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -84,6 +84,11 @@ impl<T:Eq + Hash + Freeze + Clone + 'static> Interner<T> { None => None, } } + + pub fn clear(&self) { + *self.map.borrow_mut().get() = HashMap::new(); + *self.vect.borrow_mut().get() = Vec::new(); + } } #[deriving(Clone, Eq, Hash, Ord)] @@ -222,6 +227,11 @@ impl StrInterner { None => None, } } + + pub fn clear(&self) { + *self.map.borrow_mut().get() = HashMap::new(); + *self.vect.borrow_mut().get() = Vec::new(); + } } #[cfg(test)] |
