Re-enable system allocator.
This commit is contained in:
parent
4e5028ccb5
commit
340d1026d2
|
@ -16,6 +16,7 @@ path = "src/bin/peer_node.rs"
|
|||
# Used for debugging memory usage.
|
||||
exit_upon_epoch_1000 = []
|
||||
|
||||
|
||||
[dependencies]
|
||||
log = "*"
|
||||
env_logger = "*"
|
||||
|
|
|
@ -120,7 +120,7 @@ fn main() {
|
|||
None => HashSet::new(),
|
||||
};
|
||||
|
||||
let mut cfg = Config::new();
|
||||
let mut cfg = Config::default();
|
||||
|
||||
if let Some(bs) = matches.value_of("batch-size") {
|
||||
cfg.batch_size = bs.parse().expect("Invalid batch size.");
|
||||
|
|
|
@ -60,7 +60,7 @@ pub struct Config {
|
|||
}
|
||||
|
||||
impl Config {
|
||||
pub fn new() -> Config {
|
||||
pub fn with_defaults() -> Config {
|
||||
Config {
|
||||
batch_size: BATCH_SIZE,
|
||||
txn_gen_count: NEW_TXNS_PER_INTERVAL,
|
||||
|
@ -72,6 +72,12 @@ impl Config {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Config {
|
||||
Config::with_defaults()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// The `Arc` wrapped portion of `Hydrabadger`.
|
||||
///
|
||||
|
@ -149,7 +155,7 @@ impl Hydrabadger {
|
|||
|
||||
/// Returns a new Hydrabadger node.
|
||||
pub fn with_defaults(addr: SocketAddr) -> Self {
|
||||
Hydrabadger::new(addr, Config::new())
|
||||
Hydrabadger::new(addr, Config::default())
|
||||
}
|
||||
|
||||
/// Returns the pre-created handler.
|
||||
|
|
25
src/lib.rs
25
src/lib.rs
|
@ -1,17 +1,21 @@
|
|||
// #![feature(alloc_system, allocator_api)]
|
||||
// extern crate alloc_system;
|
||||
#![cfg_attr(feature = "nightly", feature(alloc_system))]
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
extern crate alloc_system;
|
||||
extern crate clap;
|
||||
extern crate env_logger;
|
||||
#[macro_use] extern crate log;
|
||||
#[macro_use] extern crate failure;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate failure;
|
||||
extern crate crossbeam;
|
||||
// #[macro_use] extern crate crossbeam_channel;
|
||||
extern crate crypto;
|
||||
extern crate chrono;
|
||||
extern crate num_traits;
|
||||
extern crate num_bigint;
|
||||
#[macro_use] extern crate futures;
|
||||
#[macro_use]
|
||||
extern crate futures;
|
||||
extern crate tokio;
|
||||
extern crate tokio_codec;
|
||||
extern crate tokio_io;
|
||||
|
@ -19,7 +23,8 @@ extern crate rand;
|
|||
extern crate bytes;
|
||||
extern crate uuid;
|
||||
extern crate byteorder;
|
||||
#[macro_use] extern crate serde_derive;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate serde;
|
||||
extern crate serde_bytes;
|
||||
extern crate bincode;
|
||||
|
@ -28,10 +33,12 @@ extern crate parking_lot;
|
|||
extern crate clear_on_drop;
|
||||
extern crate hbbft;
|
||||
|
||||
// use alloc_system::System;
|
||||
#[cfg(feature = "nightly")]
|
||||
use alloc_system::System;
|
||||
|
||||
// #[global_allocator]
|
||||
// static A: System = System;
|
||||
#[cfg(feature = "nightly")]
|
||||
#[global_allocator]
|
||||
static A: System = System;
|
||||
|
||||
// pub mod network;
|
||||
pub mod hydrabadger;
|
||||
|
|
Loading…
Reference in New Issue