Skip to content

Commit

Permalink
fix: Fix allocator for modern Rust (uncomplete)
Browse files Browse the repository at this point in the history
  • Loading branch information
pravic committed Sep 13, 2017
1 parent 4319369 commit ad962d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ test = false

[dependencies]
core = { path= "../../../libcore" }
alloc = { path = "../../../liballoc" }
17 changes: 10 additions & 7 deletions src/alloc/alloc.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
//! Kernel Mode Allocator
// The compiler needs to be instructed that this crate is an allocator in order
// to realize that when this is linked in another allocator like jemalloc should
// not be linked in
#![feature(allocator)]
#![allocator]
#![crate_name = "alloc_system"]
#![crate_type = "rlib"]

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

#![crate_name = "alloc_system"]
#![crate_type = "rlib"]
// The compiler needs to be instructed that this crate is an allocator in order
// to realize that when this is linked in another allocator like jemalloc should
// not be linked in
#![feature(global_allocator)]
#![feature(default_lib_allocator)]
//#![allocator]



mod pool;

Expand Down

0 comments on commit ad962d1

Please sign in to comment.