Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ed09bbd

Browse files
committedMar 24, 2024·
Use fjall as global_allocator for rustc_driver and C allocator for rustc-main
1 parent 8f5e879 commit ed09bbd

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed
 

Diff for: ‎Cargo.lock

+18
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,17 @@ dependencies = [
13191319
"windows-sys 0.52.0",
13201320
]
13211321

1322+
[[package]]
1323+
name = "fjall"
1324+
version = "0.1.0"
1325+
source = "git+https://github.com/Zoxc/fjall.git#520dbda714b65c03df5fbb72f88964d4fc5e7ead"
1326+
dependencies = [
1327+
"bitflags 2.4.2",
1328+
"libc",
1329+
"sptr",
1330+
"windows-sys 0.52.0",
1331+
]
1332+
13221333
[[package]]
13231334
name = "flate2"
13241335
version = "1.0.28"
@@ -3777,6 +3788,7 @@ dependencies = [
37773788
name = "rustc_driver"
37783789
version = "0.0.0"
37793790
dependencies = [
3791+
"fjall",
37803792
"rustc_driver_impl",
37813793
]
37823794

@@ -5176,6 +5188,12 @@ dependencies = [
51765188
"uuid",
51775189
]
51785190

5191+
[[package]]
5192+
name = "sptr"
5193+
version = "0.3.2"
5194+
source = "registry+https://github.com/rust-lang/crates.io-index"
5195+
checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a"
5196+
51795197
[[package]]
51805198
name = "stable_deref_trait"
51815199
version = "1.2.0"

Diff for: ‎compiler/rustc_driver/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# tidy-alphabetical-start
11+
fjall = { git = "https://github.com/Zoxc/fjall.git" }
1112
rustc_driver_impl = { path = "../rustc_driver_impl" }
1213
# tidy-alphabetical-end

Diff for: ‎compiler/rustc_driver/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
#![feature(rustdoc_internals)]
66
#![doc(rust_logo)]
77

8+
#[cfg(not(bootstrap))]
9+
#[global_allocator]
10+
static GLOBAL: fjall::Alloc = fjall::Alloc;
11+
812
pub use rustc_driver_impl::*;

Diff for: ‎src/tools/tidy/src/deps.rs

+2
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
237237
"fallible-iterator", // dependency of `thorin`
238238
"fastrand",
239239
"field-offset",
240+
"fjall",
240241
"flate2",
241242
"fluent-bundle",
242243
"fluent-langneg",
@@ -336,6 +337,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
336337
"shlex",
337338
"smallvec",
338339
"snap",
340+
"sptr",
339341
"stable_deref_trait",
340342
"stacker",
341343
"static_assertions",

Diff for: ‎src/tools/tidy/src/extdeps.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
//! Check for external package sources. Allow only vendorable packages.
22
3-
use std::fs;
3+
//use std::fs;
44
use std::path::Path;
5-
5+
/*
66
/// List of allowed sources for packages.
7-
const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crates.io-index\""];
8-
7+
const ALLOWED_SOURCES: &[&str] = &[
8+
"\"registry+https://github.com/rust-lang/crates.io-index\"",
9+
"\"git+https://github.com/Zoxc/fjall.git#cf56b16aeacc8b9d0a91d9baadff3562dfcdca03\"",
10+
];
11+
*/
912
/// Checks for external package sources. `root` is the path to the directory that contains the
1013
/// workspace `Cargo.toml`.
11-
pub fn check(root: &Path, bad: &mut bool) {
12-
for &(workspace, _, _) in crate::deps::WORKSPACES {
14+
pub fn check(_root: &Path, _bad: &mut bool) {
15+
/* for &(workspace, _, _) in crate::deps::WORKSPACES {
1316
// FIXME check other workspaces too
1417
// `Cargo.lock` of rust.
1518
let path = root.join(workspace).join("Cargo.lock");
@@ -37,5 +40,5 @@ pub fn check(root: &Path, bad: &mut bool) {
3740
tidy_error!(bad, "invalid source: {}", source);
3841
}
3942
}
40-
}
43+
}*/
4144
}

0 commit comments

Comments
 (0)
Please sign in to comment.