pub fn reserve(&mut self, additional_capacity: usize) {
        let start = self.items.len();
        let end = self.items.len() + additional_capacity;
        let old_head = self.free_list_head;
        self.items.reserve_exact(additional_capacity);
        self.items.extend((start..end).map(|i| {
            if i == end - 1 {
                Entry::Free {
                    next_free: old_head,
                }
            } else {
                Entry::Free {
                    next_free: Some(i as u32 + 1),
                }
            }
        }));
        self.free_list_head = Some(start as u32);
    }
/// Allocate space for `additional_capacity` more elements in the arena.
///
/// # Panics
///
/// Panics if this causes the capacity to overflow.
///
/// # Examples
///
/// ```ignore
/// use rapier::data::arena::Arena;
///
/// let mut arena = Arena::with_capacity(10);
/// arena.reserve(5);
/// assert_eq!(arena.capacity(), 15);
/// # let _: Arena<usize> = arena;
/// ```
Allocate space for `additional_capacity` more elements in the arena.
Allocate space for ` additional_capacity ` more elements in the arena .
pub fn reserve(&mut self, additional_capacity: usize) {
        let start = self.items.len();
        let end = self.items.len() + additional_capacity;
        let old_head = self.free_list_head;
        self.items.reserve_exact(additional_capacity);
        self.items.extend((start..end).map(|i| {
            if i == end - 1 {
                Entry::Free {
                    next_free: old_head,
                }
            } else {
                Entry::Free {
                    next_free: Some(i as u32 + 1),
                }
            }
        }));
        self.free_list_head = Some(start as u32);
    }
pub fn reserve ( & mut self , additional_capacity : usize ) { let start = self . items . len ( ) ; let end = self . items . len ( ) + additional_capacity ; let old_head = self . free_list_head ; self . items . reserve_exact ( additional_capacity ) ; self . items . extend ( ( start .. end ) . map ( | i | { if i == end - 1 { Entry :: Free { next_free : old_head , } } else { Entry :: Free { next_free : Some ( i as u32 + 1 ) , } } } ) ) ; self . free_list_head = Some ( start as u32 ) ; }
Allocate space for `additional_capacity` more elements in the arena.
Allocate space for ` additional_capacity ` more elements in the arena .
&mut self
additional_capacity
usize
panics
Panics if this causes the capacity to overflow.
Panics if this causes the capacity to overflow .
examples
```ignore
use rapier::data::arena::Arena.

let mut arena = Arena::with_capacity(10);
arena.reserve(5);
assert_eq!(arena.capacity(), 15).
` ` ` ignore use rapier :: data :: arena :: Arena . let mut arena = Arena :: with_capacity ( 10 ) ; arena . reserve ( 5 ) ; assert_eq! ( arena . capacity () 15 ) .
let _: arena<usize> = arena;
None