- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/LinearMath/btAlignedObjectArray.h
r2907 r2908 59 59 return (size ? size*2 : 1); 60 60 } 61 SIMD_FORCE_INLINE void copy(int start,int end, T* dest) const61 SIMD_FORCE_INLINE void copy(int start,int end, T* dest) 62 62 { 63 63 int i; … … 121 121 } 122 122 123 ///Generally it is best to avoid using the copy constructor of an btAlignedObjectArray, and use a (const) reference to the array instead. 124 btAlignedObjectArray(const btAlignedObjectArray& otherArray) 125 { 126 init(); 127 128 int otherSize = otherArray.size(); 129 resize (otherSize); 130 otherArray.copy(0, otherSize, m_data); 131 } 132 123 SIMD_FORCE_INLINE int capacity() const 124 { // return current length of allocated storage 125 return m_capacity; 126 } 133 127 134 135 /// return the number of elements in the array136 128 SIMD_FORCE_INLINE int size() const 137 { 129 { // return length of sequence 138 130 return m_size; 139 131 } … … 150 142 151 143 152 ///clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.153 144 SIMD_FORCE_INLINE void clear() 154 145 { … … 166 157 } 167 158 168 ///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.169 ///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.170 159 SIMD_FORCE_INLINE void resize(int newsize, const T& fillData=T()) 171 160 { … … 231 220 232 221 233 /// return the pre-allocated (reserved) elements, this is at least as large as the total number of elements,see size() and reserve()234 SIMD_FORCE_INLINE int capacity() const235 {236 return m_capacity;237 }238 222 239 223 SIMD_FORCE_INLINE void reserve(int _Count)
Note: See TracChangeset
for help on using the changeset viewer.