pub fn alloc_write_space(&mut self, size: u64) -> P {
        let fileno = self.last_file - 1;
        let max_size = self.max_size;

        // try to allocate some space in the last file
        let write_pos = self
            .get_flatfile(fileno)
            .alloc_write(size, max_size);


        match write_pos {
            None => {

                // we will create space for another file
                self.files.push(None);
                self.last_file += 1;

                // call self using the new new last_file
                self.alloc_write_space(size)

            }
            Some(pos) => {
                P::new(fileno, pos)
            }
        }
    }
/// Reserves `size` bytes in the flatfileset
///
/// Creates a new file if needed
/// Allocation occurs atomically but lock-free
/// Returns a pointer to where size bytes can be stored
Reserves `size` bytes in the flatfileset
Creates a new file if needed
Allocation occurs atomically but lock-free
Returns a pointer to where size bytes can be stored
Reserves ` size ` bytes in the flatfileset Creates a new file if needed Allocation occurs atomically but lock - free Returns a pointer to where size bytes can be stored
pub fn alloc_write_space(&mut self, size: u64) -> P {
        let fileno = self.last_file - 1;
        let max_size = self.max_size;
        // try to allocate some space in the last file
        let write_pos = self
            .get_flatfile(fileno)
            .alloc_write(size, max_size);
        match write_pos {
            None => {
                // we will create space for another file
                self.files.push(None);
                self.last_file += 1;
                // call self using the new new last_file
                self.alloc_write_space(size)
            }
            Some(pos) => {
                P::new(fileno, pos)
            }
        }
    }
pub fn alloc_write_space ( & mut self , size : u64 ) -> P { let fileno = self . last_file - 1 ; let max_size = self . max_size ; // try to allocate some space in the last file let write_pos = self . get_flatfile ( fileno ) . alloc_write ( size , max_size ) ; match write_pos { None => { // we will create space for another file self . files . push ( None ) ; self . last_file += 1 ; // call self using the new new last_file self . alloc_write_space ( size ) } Some ( pos ) => { P :: new ( fileno , pos ) } } }
Reserves `size` bytes in the flatfileset
Creates a new file if needed
Allocation occurs atomically but lock-free
Returns a pointer to where size bytes can be stored
Reserves ` size ` bytes in the flatfileset Creates a new file if needed Allocation occurs atomically but lock - free Returns a pointer to where size bytes can be stored
&mut self
size
u64
&mut self
size
u64