git-svn-id: svn://db.shs.com.ru/pip@811 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -324,16 +324,12 @@ private:
|
||||
elementDelete(d[i]);
|
||||
}
|
||||
}
|
||||
inline void deleteRaw(T *& d) {
|
||||
if ((uchar*)d != 0) free((uchar*)d);
|
||||
d = 0;
|
||||
}
|
||||
inline void zeroRaw(T * d, size_t s) {
|
||||
if ((uchar*)d != 0) memset(d, 0, s*sizeof(T));
|
||||
}
|
||||
inline void elementNew(T * to, const T & from) {new(to)T(from);}
|
||||
inline void elementDelete(T & from) {from.~T();}
|
||||
inline void dealloc() {deleteRaw(piv_data);}
|
||||
inline void dealloc() {
|
||||
if ((uchar*)piv_data != 0) free((uchar*)piv_data);
|
||||
piv_data = 0;
|
||||
}
|
||||
inline void alloc(size_t new_size) {
|
||||
if (new_size <= piv_rsize) {
|
||||
piv_size = new_size;
|
||||
@@ -418,10 +414,18 @@ __PIVECTOR_SIMPLE_FUNCTIONS__(ldouble)*/
|
||||
template<> inline void PIVector<T>::deleteT(T * d, size_t sz) {PIINTROSPECTION_CONTAINER_UNUSED(T, sz*sizeof(T));} \
|
||||
template<> inline void PIVector<T>::elementNew(T * to, const T & from) {(*to) = from;} \
|
||||
template<> inline void PIVector<T>::elementDelete(T & from) {;} \
|
||||
template<> inline PIVector<T> & PIVector<T>::_resizeRaw(size_t new_size) {alloc(new_size); return *this;} \
|
||||
template<> inline PIVector<T> & PIVector<T>::_resizeRaw(size_t new_size) { \
|
||||
if (new_size > piv_size) { \
|
||||
PIINTROSPECTION_CONTAINER_USED(T, (new_size-piv_size)*sizeof(T)); \
|
||||
} \
|
||||
if (new_size < piv_size) { \
|
||||
PIINTROSPECTION_CONTAINER_UNUSED(T, (piv_size-new_size)*sizeof(T)); \
|
||||
} \
|
||||
alloc(new_size); \
|
||||
return *this; \
|
||||
} \
|
||||
template<> inline PIVector<T> & PIVector<T>::clear() {PIINTROSPECTION_CONTAINER_UNUSED(T, piv_size*sizeof(T)); piv_size = 0; return *this;} \
|
||||
template<> inline PIVector<T> & PIVector<T>::assign(size_t new_size, const T & f) {\
|
||||
_resizeRaw(new_size); return fill(f);}
|
||||
template<> inline PIVector<T> & PIVector<T>::assign(size_t new_size, const T & f) {_resizeRaw(new_size); return fill(f);}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user