]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #30863 - jseyfried:no_rc, r=eddyb
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 13 Jan 2016 22:52:20 +0000 (04:22 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 14 Jan 2016 05:34:43 +0000 (11:04 +0530)
Use arena allocation instead of reference counting for `Module`s to fix memory leaks from `Rc` cycles.

A module references its module children and its import resolutions, and an import resolution references the module defining the imported name, so there is a cycle whenever a module imports something from an ancestor module.

For example,
```rust
mod foo { // `foo` references `bar`.
    fn baz() {}
    mod bar { // `bar` references the import.
        use foo::baz; // The import references `foo`.
    }
}
```

1  2 
mk/crates.mk

diff --combined mk/crates.mk
index 7542d91ce6d50afdd9edf90c2660544c16a777e8,9d6215a51cc88396024281fcb7fd03e44a82cee9..be53234cb02e2ca402f07197251ae7b435696f8e
@@@ -103,7 -103,7 +103,7 @@@ DEPS_rustc_lint := rustc log synta
  DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
  DEPS_rustc_metadata := rustc rustc_front syntax rbml
  DEPS_rustc_mir := rustc rustc_front syntax
- DEPS_rustc_resolve := rustc rustc_front log syntax
+ DEPS_rustc_resolve := arena rustc rustc_front log syntax
  DEPS_rustc_platform_intrinsics := rustc rustc_llvm
  DEPS_rustc_plugin := rustc rustc_metadata syntax
  DEPS_rustc_privacy := rustc rustc_front log syntax
@@@ -175,5 -175,9 +175,5 @@@ ende
  
  $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))
  
 -ifdef CFG_DISABLE_ELF_TLS
 -RUSTFLAGS_std := --cfg no_elf_tls
 -endif
 -
  CRATEFILE_libc := $(SREL)src/liblibc/src/lib.rs
  RUSTFLAGS_libc := --cfg stdbuild