Skip to content

Commit ad962d1

Browse files
committed
fix: Fix allocator for modern Rust (uncomplete)
See rust-lang/rfcs#1974
1 parent 4319369 commit ad962d1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/alloc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ test = false
1313

1414
[dependencies]
1515
core = { path= "../../../libcore" }
16+
alloc = { path = "../../../liballoc" }

src/alloc/alloc.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
//! Kernel Mode Allocator
22
3-
// The compiler needs to be instructed that this crate is an allocator in order
4-
// to realize that when this is linked in another allocator like jemalloc should
5-
// not be linked in
6-
#![feature(allocator)]
7-
#![allocator]
3+
#![crate_name = "alloc_system"]
4+
#![crate_type = "rlib"]
85

96
// Allocators are not allowed to depend on the standard library which in turn
107
// requires an allocator in order to avoid circular dependencies. This crate,
118
// however, can use all of libcore.
129
#![no_std]
1310

14-
#![crate_name = "alloc_system"]
15-
#![crate_type = "rlib"]
11+
// The compiler needs to be instructed that this crate is an allocator in order
12+
// to realize that when this is linked in another allocator like jemalloc should
13+
// not be linked in
14+
#![feature(global_allocator)]
15+
#![feature(default_lib_allocator)]
16+
//#![allocator]
17+
18+
1619

1720
mod pool;
1821

0 commit comments

Comments
 (0)