/// Determine for a Layout how many pages we need taking into
/// account the type of allocator that will end up handling the request.
Determine for a Layout how many pages we need taking into
account the type of allocator that will end up handling the request.
Determine for a Layout how many pages we need taking into account the type of allocator that will end up handling the request .
fn refill_amount(layout: Layout) -> (usize, usize) {
        match KernelAllocator::allocator_for(layout) {
            AllocatorType::Zone => {
                if layout.size() <= slabmalloc::ZoneAllocator::MAX_BASE_ALLOC_SIZE {
                    (1, 0)
                } else {
                    (0, 1)
                }
            }
            AllocatorType::MemManager => {
                if layout.size() <= BASE_PAGE_SIZE {
                    (1, 0)
                } else {
                    (0, 1)
                }
            }
            AllocatorType::MapBig => KernelAllocator::layout_to_pages(layout),
        }
    }
fn refill_amount ( layout : Layout ) -> ( usize , usize ) { match KernelAllocator :: allocator_for ( layout ) { AllocatorType :: Zone => { if layout . size ( ) <= slabmalloc :: ZoneAllocator :: MAX_BASE_ALLOC_SIZE { ( 1 , 0 ) } else { ( 0 , 1 ) } } AllocatorType :: MemManager => { if layout . size ( ) <= BASE_PAGE_SIZE { ( 1 , 0 ) } else { ( 0 , 1 ) } } AllocatorType :: MapBig => KernelAllocator :: layout_to_pages ( layout ) , } }
Determine for a Layout how many pages we need taking into
account the type of allocator that will end up handling the request.
Determine for a Layout how many pages we need taking into account the type of allocator that will end up handling the request .
layout
Layout