Move allocator to libtock_core
diff --git a/Cargo.toml b/Cargo.toml index 50c20ef..51e49db 100644 --- a/Cargo.toml +++ b/Cargo.toml
@@ -6,13 +6,12 @@ edition = "2018" [features] -alloc = [ "linked_list_allocator" ] +alloc = ["libtock-core/alloc"] [dependencies] core = { package = "async-support", path = "async-support" } libtock-core = { path = "core" } libtock_codegen = { path = "codegen" } -linked_list_allocator = { optional = true, version = "=0.6.5", default-features = false } futures = { version = "0.3.1", default-features = false, features = ["unstable", "cfg-target-has-atomic"] } [dev-dependencies]
diff --git a/core/Cargo.toml b/core/Cargo.toml index 6f300f4..b154552 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml
@@ -6,4 +6,8 @@ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +alloc = [ "linked_list_allocator" ] + [dependencies] +linked_list_allocator = { optional = true, version = "=0.6.5", default-features = false } \ No newline at end of file
diff --git a/src/alloc.rs b/core/src/alloc.rs similarity index 100% rename from src/alloc.rs rename to core/src/alloc.rs
diff --git a/core/src/lib.rs b/core/src/lib.rs index c8ffa54..e465f4d 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs
@@ -1,6 +1,9 @@ #![feature(asm, lang_items, naked_functions)] #![cfg_attr(any(target_arch = "arm", target_arch = "riscv32"), no_std)] +#![cfg_attr(feature = "alloc", feature(alloc_error_handler))] +#[cfg(feature = "alloc")] +mod alloc; mod entry_point; #[cfg(any(target_arch = "arm", target_arch = "riscv32"))] mod lang_items;
diff --git a/src/lib.rs b/src/lib.rs index 2ff6cca..0aabb1a 100644 --- a/src/lib.rs +++ b/src/lib.rs
@@ -1,9 +1,5 @@ -#![cfg_attr(feature = "alloc", feature(alloc_error_handler))] #![cfg_attr(any(target_arch = "arm", target_arch = "riscv32"), no_std)] -#[cfg(feature = "alloc")] -mod alloc; - pub mod adc; pub mod ble_composer; pub mod ble_parser;