pub fn push(&mut self, other: T){
        if self.size < N{ // insert into stack
            self.s_buf[self.size] = other;
            self.size += 1;
        } else if self.size < self.capacity{ // insert into heap
            unsafe {*((self.d_buf.unwrap() as usize + (self.size - N) * size_of::<T>()) as *mut T) = other};
            self.size += 1;
        }
    }
/// Safely push a value into the SmartBuffer
Safely push a value into the SmartBuffer
Safely push a value into the SmartBuffer
pub fn push(&mut self, other: T){
        if self.size < N{ // insert into stack
            self.s_buf[self.size] = other;
            self.size += 1;
        } else if self.size < self.capacity{ // insert into heap
            unsafe {*((self.d_buf.unwrap() as usize + (self.size - N) * size_of::<T>()) as *mut T) = other};
            self.size += 1;
        }
    }
pub fn push ( & mut self , other : T ) { if self . size < N { // insert into stack self . s_buf [ self . size ] = other ; self . size += 1 ; } else if self . size < self . capacity { // insert into heap unsafe { * ( ( self . d_buf . unwrap ( ) as usize + ( self . size - N ) * size_of :: < T > ( ) ) as * mut T ) = other } ; self . size += 1 ; } }
Safely push a value into the SmartBuffer
Safely push a value into the SmartBuffer
&mut self
other
T
&mut self
other
T