LINUX.ORG.RU

История изменений

Исправление Deleted, (текущая версия) :

операционная система, написанная на Rust

pub extern "C" fn __rust_reallocate(ptr: *mut u8,
                                    old_size: usize,
                                    size: usize,
                                    align: usize)
                                    -> *mut u8 {
    unsafe { realloc(ptr as usize, size) as *mut u8 }
}
pub extern "C" fn panic_fmt(args: fmt::Arguments, file: &'static str, line: u32) -> ! {
    debug::d(file);
    debug::d(":");
    debug::dd(line as usize);
    debug::d(": ");
    let _ = fmt::write(&mut DebugStream, args);
    debug::dl();

    unsafe {
        loop {
            asm!("sti");
            asm!("hlt");
        }
    }
}

designed to be modular and secure

redox (master) $ grep -r unsafe | wc -l
672

Ясно.

Исходная версия Deleted, :

операционная система, написанная на Rust

pub extern "C" fn __rust_reallocate(ptr: *mut u8,
                                    old_size: usize,
                                    size: usize,
                                    align: usize)
                                    -> *mut u8 {
    unsafe { realloc(ptr as usize, size) as *mut u8 }
}
pub extern "C" fn panic_fmt(args: fmt::Arguments, file: &'static str, line: u32) -> ! {
    debug::d(file);
    debug::d(":");
    debug::dd(line as usize);
    debug::d(": ");
    let _ = fmt::write(&mut DebugStream, args);
    debug::dl();

    unsafe {
        loop {
            asm!("sti");
            asm!("hlt");
        }
    }
}

designed to be modular and secure

redox (master) $ grep -r unsafe | wc -l
672

Ясно.