Skip to content

Commit

Permalink
Use unstable feature gate for NUMA allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
vertexclique committed Nov 5, 2019
1 parent c4cd383 commit caa6b02
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
9 changes: 7 additions & 2 deletions bastion-executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ readme = "README.md"
license = "Apache-2.0/MIT"
edition = "2018"

[features]
unstable = ["numanji", "allocator-suite"]

[dependencies]
crossbeam-utils = "0.6"
crossbeam-epoch = "0.7"
Expand All @@ -20,9 +23,11 @@ libc = "0.2"
num_cpus = "1.10"
rustc-hash = "1.0.1"
pin-utils = "0.1.0-alpha.4"
numanji = "^0.1"
allocator-suite = "^0.1"
lightproc = { "path" = "../lightproc" }

# Allocator
numanji = { version = "^0.1", optional = true, default-features = false}
allocator-suite = { version = "^0.1", optional = true, default-features = false}

[target.'cfg(not(any(target_os = "android", target_os = "linux")))'.dependencies]
jemallocator = "^0.3"
10 changes: 6 additions & 4 deletions bastion-executor/src/allocator.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Allocation selector import
use numanji::*;
unstable_api! {
// Allocation selector import
use numanji::*;

// Drive selection of allocator here
autoselect!();
// Drive selection of allocator here
autoselect!();
}
11 changes: 4 additions & 7 deletions bastion-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
//!
//! NUMA-aware SMP based Fault-tolerant Executor
//!
//!
// Allocator features
#![feature(allocator_api)]
#![feature(extern_types)]
#![feature(core_intrinsics)]
#![feature(libstd_sys_internals)]
#![feature(thread_local)]
#![feature(const_fn)]
// Force missing implementations
#![warn(missing_docs)]
#![warn(missing_debug_implementations)]

#[macro_use]
mod macros;

pub mod allocator;
pub mod blocking_pool;
pub mod distributor;
Expand Down
9 changes: 9 additions & 0 deletions bastion-executor/src/macros.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#[doc(hidden)]
macro_rules! unstable_api {
($($block:item)*) => {
$(
#[cfg(feature = "unstable")]
$block
)*
}
}

0 comments on commit caa6b02

Please sign in to comment.