pub fn new(ident: Ident, chunk_size: usize, item_size: usize, storage: Rc<dyn ChunkStorage>) -> Arena {
        assert!(chunk_size >= item_size);

        let len = Value::<usize>::load_or_default(ident.sub("len"), 0, Rc::clone(&storage));
        let mut chunks = Vec::new();

        let mut item_offset = 0;

        while item_offset < *len {
            chunks.push(storage.load_chunk(ident.sub(item_offset)));
            item_offset += chunk_size / item_size;
        }

        Arena {
            ident,
            chunks,
            chunk_size,
            item_size,
            len,
            storage
        }
    }
/// Create a new arena given a chunk group identifier, chunk size and (max) item size
Create a new arena given a chunk group identifier, chunk size and (max) item size
Create a new arena given a chunk group identifier chunk size and ( max ) item size
pub fn new(ident: Ident, chunk_size: usize, item_size: usize, storage: Rc<dyn ChunkStorage>) -> Arena {
        assert!(chunk_size >= item_size);
        let len = Value::<usize>::load_or_default(ident.sub("len"), 0, Rc::clone(&storage));
        let mut chunks = Vec::new();
        let mut item_offset = 0;
        while item_offset < *len {
            chunks.push(storage.load_chunk(ident.sub(item_offset)));
            item_offset += chunk_size / item_size;
        }
        Arena {
            ident,
            chunks,
            chunk_size,
            item_size,
            len,
            storage
        }
    }
pub fn new ( ident : Ident , chunk_size : usize , item_size : usize , storage : Rc < dyn ChunkStorage > ) -> Arena { assert ! ( chunk_size item_size ) ; let len = Value :: < usize > :: load_or_default ( ident . sub ( " " ) , 0 , Rc :: clone ( & storage ) ) ; let mut chunks = Vec :: new ( ) ; let mut item_offset = 0 ; while item_offset < * len { chunks . push ( storage . load_chunk ( ident . sub ( item_offset ) ) ) ; item_offset += chunk_size / item_size ; } Arena { ident , chunks , chunk_size , item_size , len , storage } }
Create a new arena given a chunk group identifier, chunk size and (max) item size
Create a new arena given a chunk group identifier chunk size and ( max ) item size
ident
Ident
chunk_size
usize
item_size
usize
storage
Rc<dyn ChunkStorage>
ident
Ident
chunk_size
usize
item_size
usize
storage
Rc<dyn ChunkStorage>