Logo Search packages:      
Sourcecode: blender version File versions  Download package

SIMD_FORCE_INLINE void btAlignedObjectArray< GIM_PAIR >::resize ( int  newsize,
const GIM_PAIR fillData = T() 
) [inline, inherited]

resize changes the number of elements in the array. If the new size is larger, the new elements will be constructed using the optional second argument. when the new number of elements is smaller, the destructor will be called, but memory will not be freed, to reduce performance overhead of run-time memory (de)allocations.

Definition at line 170 of file btAlignedObjectArray.h.

            {
                  int curSize = size();

                  if (newsize < size())
                  {
                        for(int i = curSize; i < newsize; i++)
                        {
                              m_data[i].~T();
                        }
                  } else
                  {
                        if (newsize > size())
                        {
                              reserve(newsize);
                        }
#ifdef BT_USE_PLACEMENT_NEW
                        for (int i=curSize;i<newsize;i++)
                        {
                              new ( &m_data[i]) T(fillData);
                        }
#endif //BT_USE_PLACEMENT_NEW

                  }

                  m_size = newsize;
            }


Generated by  Doxygen 1.6.0   Back to index