diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-04-27 14:21:17 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-04-30 10:44:31 -0700 |
| commit | 2bb3b63ec4379b812aeceb690d78763ec55d3cbb (patch) | |
| tree | f189a83d88971f52d155fb91438a4d8ad81033a4 /src/rustc | |
| parent | dc117fecde14706b3ab5fbcd64f743dba6de9e1b (diff) | |
| download | rust-2bb3b63ec4379b812aeceb690d78763ec55d3cbb.tar.gz rust-2bb3b63ec4379b812aeceb690d78763ec55d3cbb.zip | |
Eliminate a copy in syntax::parse::new_parser_from_file
Fixing a FIXME turned out to be pretty involved. I added an io function that returns a unique boxed string (for the contents of a file) rather than a string, and went from there. Also made the src field of codemap a unique boxed string. This doesn't seem to make that much difference in amount of allocation according to valgrind (disappointingly), but I also had to introduce a copy somewhere else pending a new snapshot, so maybe that's it.
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/driver/driver.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index 75c75c3217b..06e54c84b57 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -78,7 +78,7 @@ fn parse_input(sess: session, cfg: ast::crate_cfg, input: str) if !input_is_stdin(input) { parse::parse_crate_from_file(input, cfg, sess.parse_sess) } else { - let src = @str::from_bytes(io::stdin().read_whole_stream()); + let src = ~str::from_bytes(io::stdin().read_whole_stream()); parse::parse_crate_from_source_str(input, src, cfg, sess.parse_sess) } } |
