pub fn new(file: &std::fs::File) -> Result<Self, Box<dyn Error>> {
        let mut content_buf = unsafe { MmapOptions::new().map_copy(file)? };
        let internal_buf = content_buf.as_mut_ptr();

        let has_work = Arc::new(AtomicBool::new(false));

        // This is ok, because it is the len of a memmap buffer, it is limited
        // by the size of the addressing space anyways.
        #[allow(clippy::cast_possible_truncation)]
        let window_end =
            Arc::new(AtomicUsize::new(SYNC_BUFF_LEN.min(file.metadata()?.len() as usize)));

        let (tx, rx) = crossbeam::channel::unbounded();

        AsyncBuffer::process_messages(
            #[allow(clippy::cast_possible_truncation)]
            (internal_buf, file.metadata()?.len() as usize),
            rx,
            has_work.clone(),
            window_end.clone(),
        );

        #[allow(clippy::cast_possible_truncation)]
        Ok(Self { content_buf, len: file.metadata()?.len() as usize, tx, has_work, window_end })
    }
Create 2 copy-on-write memmaps of the same file. Since they are shared,
they edit the same underlying buffer. Store one of the buffers for use
for background processing by [`AsyncBuffer::process_messages`]
src/buffer.rs