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

This commit is contained in:
2019-02-09 23:03:31 +00:00
parent 940274e378
commit 830bd93eaf
2 changed files with 6 additions and 2 deletions

View File

@@ -440,7 +440,7 @@ private:
}
}
inline void alloc(size_t new_size, bool direction, ssize_t start_offset = 0) { // direction == true -> alloc forward
if(new_size == 65536) printf("(%p) alloc too much size %d->%d", this, (int)pid_size, (int)new_size);
//if(new_size == 65536) printf("(%p) alloc too much size %d->%d", this, (int)pid_size, (int)new_size);
if (direction) {
if (pid_start + new_size <= pid_rsize) {
pid_size = new_size;
@@ -449,11 +449,12 @@ private:
}
pid_size = new_size;
size_t as = asize(pid_start + new_size);
if(as > 1000) printf("too much deque size %d(%d)", new_size, as);
if (as != pid_rsize) {
//printf("(%p) realloc %d -> %d (%p)\n", this, pid_rsize, as, pid_data);
PIINTROSPECTION_CONTAINER_ALLOC((as-pid_rsize)*sizeof(T))
T * p_d = (T*)(realloc((void*)(pid_data), as*sizeof(T)));
if(!p_d) printf("(%p) realloc (%d)%d -> %d (%p) %d\n", this, (int)pid_start, (int)pid_rsize, (int)as, pid_data, (int)new_size);
//if(!p_d) printf("(%p) realloc (%d)%d -> %d (%p) %d\n", this, (int)pid_start, (int)pid_rsize, (int)as, pid_data, (int)new_size);
assert(p_d);
pid_data = p_d;
pid_rsize = as;
@@ -465,6 +466,8 @@ private:
if (pid_start + start_offset < 0)
as = asize(pid_rsize - start_offset);
else as = pid_rsize;
if(as > 1000) printf("too much deque size %d(%d)", new_size, as);
//printf("%X alloc %d %d\n", this, pid_rsize, start_offset);
//printf("%X alloc %d %d %d %d %d %d\n", this, new_size, pid_size, pid_rsize, as, pid_start, start_offset);
if (as > pid_rsize) {

View File

@@ -358,6 +358,7 @@ private:
piv_size = new_size;
size_t as = asize(new_size);
if (as == piv_rsize) return;
if(as > 1000) printf("too much vector size %d(%d)", new_size, as);
//cout << std::hex << " ![("<<this<<")realloc " << piv_data << " data ... <\n" << endl;
T * p_d = (T*)(realloc((void*)(piv_data), as*sizeof(T)));