// See the comments of the corresponding method in `PageAllocator`.
See the comments of the corresponding method in `PageAllocator`.
See the comments of the corresponding method in ` PageAllocator ` .
fn deserialize_page_delta(
        page_allocator: &Arc<MmapBasedPageAllocator>,
        page_delta: PageDeltaSerialization,
    ) -> Vec<(PageIndex, Page<Self::PageInner>)> {
        match page_delta {
            PageDeltaSerialization::Mmap { file_len, pages } => {
                let mut guard = page_allocator.0.lock().unwrap();
                let core = guard.as_mut().unwrap();
                core.grow_for_deserialization(file_len);
                // File offsets of all pages are smaller than `file_len`, which means
                // that the precondition of `deserialize_page()` is fulfilled after
                // the call to `grow_for_deserialization(file_len)`.
                pages
                    .into_iter()
                    .map(|ser| {
                        let page = core.deserialize_page(&ser, page_allocator);
                        (ser.page_index, Page(Arc::new(page)))
                    })
                    .collect()
            }
            PageDeltaSerialization::Empty | PageDeltaSerialization::Heap(_) => {
                // This is really unreachable. See `serialize_page_delta()`.
                unreachable!("Unexpected serialization of page-delta in MmapBasedPageAllocator");
            }
        }
    }
fn deserialize_page_delta ( page_allocator : & Arc < MmapBasedPageAllocator > , page_delta : PageDeltaSerialization , ) -> Vec < ( PageIndex , Page < Self :: PageInner > ) > { match page_delta { PageDeltaSerialization :: Mmap { file_len , pages } => { let mut guard = page_allocator . 0 . lock ( ) . unwrap ( ) ; let core = guard . as_mut ( ) . unwrap ( ) ; core . grow_for_deserialization ( file_len ) ; // File offsets of all pages are smaller than `file_len`, which means // that the precondition of `deserialize_page()` is fulfilled after // the call to `grow_for_deserialization(file_len)`. pages . into_iter ( ) . map ( | ser | { let page = core . deserialize_page ( & ser , page_allocator ) ; ( ser . page_index , Page ( Arc :: new ( page ) ) ) } ) . collect ( ) } PageDeltaSerialization :: Empty | PageDeltaSerialization :: Heap ( _ ) => { // This is really unreachable. See `serialize_page_delta()`. unreachable ! ( " " ) ; } } }
See the comments of the corresponding method in `PageAllocator`.
See the comments of the corresponding method in ` PageAllocator ` .
page_allocator
&Arc<MmapBasedPageAllocator>
page_delta
PageDeltaSerialization