[TD-5694]<fix>: fix
This commit is contained in:
parent
7b1fce481a
commit
9d6dbf4736
|
@ -25,7 +25,7 @@ static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, i
|
||||||
int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
||||||
int spaceNeeded = pCol->bytes * maxPoints;
|
int spaceNeeded = pCol->bytes * maxPoints;
|
||||||
if(IS_VAR_DATA_TYPE(pCol->type)) {
|
if(IS_VAR_DATA_TYPE(pCol->type)) {
|
||||||
spaceNeeded += sizeof(VarDataOffsetT) * maxPoints + sizeof(VarDataLenT) * maxPoints;
|
spaceNeeded += sizeof(VarDataOffsetT) * maxPoints;
|
||||||
}
|
}
|
||||||
if(pCol->spaceSize < spaceNeeded) {
|
if(pCol->spaceSize < spaceNeeded) {
|
||||||
void* ptr = realloc(pCol->pData, spaceNeeded);
|
void* ptr = realloc(pCol->pData, spaceNeeded);
|
||||||
|
@ -37,10 +37,10 @@ int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
||||||
} else {
|
} else {
|
||||||
pCol->pData = ptr;
|
pCol->pData = ptr;
|
||||||
pCol->spaceSize = spaceNeeded;
|
pCol->spaceSize = spaceNeeded;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(IS_VAR_DATA_TYPE(pCol->type)) {
|
if(IS_VAR_DATA_TYPE(pCol->type)) {
|
||||||
pCol->dataOff = POINTER_SHIFT(ptr, pCol->bytes * maxPoints);
|
pCol->dataOff = POINTER_SHIFT(pCol->pData, pCol->bytes * maxPoints);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue