1 #ifndef GfxTL__FLATCOPYVECTOR_HEADER__
2 #define GfxTL__FLATCOPYVECTOR_HEADER__
34 m_begin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
49 m_begin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
52 memcpy(m_begin,
v.m_begin,
s *
sizeof(
T));
79 m_begin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
82 memcpy(m_begin,
v.m_begin,
s *
sizeof(
T));
97 if ((
size_t)(m_capacity - m_begin) <
s)
100 T* newBegin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
103 memcpy(newBegin, m_begin, olds *
sizeof(
T));
106 m_end = newBegin + olds;
108 m_capacity = m_begin +
s;
114 return m_end - m_begin;
119 return m_capacity - m_begin;
129 if ((
size_t)(m_capacity - m_begin) >=
s)
134 T* newBegin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
137 memcpy(newBegin, m_begin,
size() *
sizeof(
T));
140 m_end = newBegin +
s;
147 size_t oldsize =
size();
151 for (
size_t i = oldsize; i <
s; ++i)
163 operator const T* ()
const
180 if (m_end >= m_capacity)
182 size_t olds =
size();
188 T* newBegin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
191 memcpy(newBegin, m_begin, olds *
sizeof(
T));
194 m_end = newBegin + olds;
196 m_capacity = m_begin +
s;
204 if (m_end >= m_capacity)
206 size_t whereIdx = where - m_begin;
207 size_t olds =
size();
213 T* newBegin = (
T*)_mm_malloc(
s *
sizeof(
T), 16);
216 memcpy(newBegin, m_begin, olds *
sizeof(
T));
219 m_end = newBegin + olds;
221 m_capacity = m_begin +
s;
222 where = m_begin + whereIdx;
224 memmove(where + 1, where, (m_end - where) *
sizeof(
T));
231 memmove(where, where + 1, (m_end - where - 1) *
sizeof(
T));
265 return std::reverse_iterator< T* >(m_end);
270 return std::reverse_iterator< const T* >(m_end);
275 return std::reverse_iterator< T* >(m_begin);
280 return std::reverse_iterator< const T* >(m_begin);