pub unsafe fn init_default(mmap: &MemoryMap) {
        if INITIALIZED.swap(true, Ordering::Relaxed) {
            panic!("BuddyAllocator::init must be called only once");
        }

        let mut cnt = 0;
        for entry in mmap.iter() {
            if let Some(single_ref) = Single::new(entry) {
                // FIXME: thread safety
                INSTANCE.lock().singles[cnt] = Some(Shared::new(single_ref));
                cnt += 1;
            }
        }
    }
/// Must be called only once in initialization process before threads initialization
Must be called only once in initialization process before threads initialization
Must be called only once in initialization process before threads initialization
pub unsafe fn init_default(mmap: &MemoryMap) {
        if INITIALIZED.swap(true, Ordering::Relaxed) {
            panic!("BuddyAllocator::init must be called only once");
        }
        let mut cnt = 0;
        for entry in mmap.iter() {
            if let Some(single_ref) = Single::new(entry) {
                // FIXME: thread safety
                INSTANCE.lock().singles[cnt] = Some(Shared::new(single_ref));
                cnt += 1;
            }
        }
    }
pub unsafe fn init_default ( mmap : & MemoryMap ) { if INITIALIZED . swap ( true , Ordering :: Relaxed ) { panic ! ( " " ) ; } let mut cnt = 0 ; for entry in mmap . iter ( ) { if let Some ( single_ref ) = Single :: new ( entry ) { // FIXME: thread safety INSTANCE . lock ( ) . singles [ cnt ] = Some ( Shared :: new ( single_ref ) ) ; cnt += 1 ; } } }
Must be called only once in initialization process before threads initialization
Must be called only once in initialization process before threads initialization
mmap
&MemoryMap
mmap
&MemoryMap