git-svn-id: svn://db.shs.com.ru/pip@811 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-06-25 12:05:22 +00:00
parent 17b37409d5
commit 6c7c81559c
3 changed files with 30 additions and 18 deletions

View File

@@ -426,7 +426,7 @@ private:
PIINTROSPECTION_CONTAINER_ALLOC(T, (as-pid_rsize)*sizeof(T))
if (pid_rsize > 0 && pid_data != 0) {
memcpy((void*)(td + ns), (const void*)(pid_data + pid_start), pid_size * sizeof(T));
deleteRaw(pid_data);
dealloc();
}
pid_data = td;
pid_rsize = as;
@@ -448,10 +448,18 @@ private:
template<> inline void PIDeque<T>::deleteT(T * d, size_t sz) {PIINTROSPECTION_CONTAINER_UNUSED(T, sz*sizeof(T));} \
template<> inline void PIDeque<T>::elementNew(T * to, const T & from) {(*to) = from;} \
template<> inline void PIDeque<T>::elementDelete(T & from) {;} \
template<> inline PIDeque<T> & PIDeque<T>::_resizeRaw(size_t new_size) {if (new_size > pid_size) alloc(new_size, true); return *this;} \
template<> inline PIDeque<T> & PIDeque<T>::_resizeRaw(size_t new_size) { \
if (new_size > pid_size) { \
PIINTROSPECTION_CONTAINER_USED(T, (new_size-pid_size)*sizeof(T)); \
} \
if (new_size < pid_size) { \
PIINTROSPECTION_CONTAINER_UNUSED(T, (pid_size-new_size)*sizeof(T)); \
} \
alloc(new_size, true); \
return *this; \
} \
template<> inline PIDeque<T> & PIDeque<T>::clear() {PIINTROSPECTION_CONTAINER_UNUSED(T, pid_size*sizeof(T)); pid_size = 0; return *this;} \
template<> inline PIDeque<T> & PIDeque<T>::assign(size_t new_size, const T & f) {\
_resizeRaw(new_size); return fill(f);}
template<> inline PIDeque<T> & PIDeque<T>::assign(size_t new_size, const T & f) {_resizeRaw(new_size); return fill(f);}
#else