From 00ed51f6f4941320c28318573e7d68bf075894ac Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 23 Dec 2017 22:15:39 +0800 Subject: [PATCH] satman: use new alloc_list (#880) --- artiq/firmware/satman/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/artiq/firmware/satman/lib.rs b/artiq/firmware/satman/lib.rs index 6cf05a137..d9a72e273 100644 --- a/artiq/firmware/satman/lib.rs +++ b/artiq/firmware/satman/lib.rs @@ -1,8 +1,8 @@ -#![feature(compiler_builtins_lib, lang_items)] +#![feature(compiler_builtins_lib, lang_items, global_allocator)] #![no_std] extern crate compiler_builtins; -extern crate alloc_artiq; +extern crate alloc_list; extern crate std_artiq as std; #[macro_use] extern crate log; @@ -218,6 +218,9 @@ fn startup() { } } +#[global_allocator] +static mut ALLOC: alloc_list::ListAlloc = alloc_list::EMPTY; + #[no_mangle] pub extern fn main() -> i32 { unsafe { @@ -225,8 +228,7 @@ pub extern fn main() -> i32 { static mut _fheap: u8; static mut _eheap: u8; } - alloc_artiq::seed(&mut _fheap as *mut u8, - &_eheap as *const u8 as usize - &_fheap as *const u8 as usize); + ALLOC.add_range(&mut _fheap, &mut _eheap); static mut LOG_BUFFER: [u8; 65536] = [0; 65536]; logger_artiq::BufferLogger::new(&mut LOG_BUFFER[..]).register(startup);