Make sure all tests and benches actually use ralloc as their global allocator See merge request redox-os/ralloc!63
@@ -3,6 +3,9 @@
extern crate ralloc;
extern crate test;
+#[global_allocator]
+static ALLOCATOR: ralloc::Allocator = ralloc::Allocator;
+
#[bench]
fn bench_box(b: &mut test::Bencher) {
b.iter(|| {
use std::sync::mpsc;
use std::thread;
@@ -5,5 +5,5 @@ extern crate test;
fn bench_sbrk(b: &mut test::Bencher) {
- b.iter(|| ralloc::sbrk(200).unwrap());
+ b.iter(|| unsafe { ralloc::sbrk(200) });
}
@@ -1,5 +1,8 @@
#![feature(test)]
use std::sync::Arc;
mod util;
#[inline(never)]
use std::collections::BTreeMap;
use std::ptr;
#[test]
fn minimal() {
let a = Box::new(1);