提交 6065a1f7 编写于 作者: Z zhaoyanggh

taosdemo compile on linux

上级 b45c0d52
......@@ -9862,15 +9862,16 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo
batchPerTblTimes = 1;
}
char *smlHead = calloc(pThreadInfo->ntables, sizeof(char *));
assert(smlHead);
char **smlHeadList = calloc(pThreadInfo->ntables, sizeof(char *));
assert(smlHeadList);
for (int t = 0; t < pThreadInfo->ntables; t++) {
smlHead[t] = (char *)calloc(HEAD_BUFF_LEN, 1);
if (NULL == smlHead[t]) {
char* smlHead = *((char **)smlHeadList + t * sizeof(char *));
smlHead = (char *)calloc(HEAD_BUFF_LEN, 1);
if (NULL == smlHead) {
errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN);
exit(EXIT_FAILURE);
}
generateSmlHead(smlHead[t], stbInfo, pThreadInfo, t);
generateSmlHead(smlHead, stbInfo, pThreadInfo, t);
}
......@@ -9920,7 +9921,7 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo
errorPrint2("Failed to alloc %d bytes, reason:%s\n",
BUFFER_SIZE, strerror(errno));
}
generateSmlTail(pThreadInfo->lines[j], smlHead[i], stbInfo, pThreadInfo, timestamp);
generateSmlTail(pThreadInfo->lines[j], *((char **)smlHeadList + i * sizeof(char *)), stbInfo, pThreadInfo, timestamp);
timestamp += timeStampStep;
}
tableSeq ++;
......@@ -10039,8 +10040,9 @@ static void* syncWriteInterlaceSml(threadInfo *pThreadInfo, uint32_t interlaceRo
free_of_interlace:
tmfree(pThreadInfo->lines);
for (int index = 0; index < pThreadInfo->ntables; index++) {
free(smlHead[index]);
tmfree(*(smlHeadList + index*(sizeof(char*))));
}
tmfree(smlHeadList);
printStatPerThread(pThreadInfo);
return NULL;
}
......@@ -10464,15 +10466,16 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) {
pThreadInfo->samplePos = 0;
char *smlHead = calloc(pThreadInfo->ntables, sizeof(char *));
assert(smlHead);
char *smlHeadList = calloc(pThreadInfo->ntables, sizeof(char *));
assert(smlHeadList);
for (int t = 0; t < pThreadInfo->ntables; t++) {
smlHead[t] = (char *)calloc(HEAD_BUFF_LEN, 1);
if (NULL == smlHead[t]) {
char* smlHead = *((char**)smlHeadList + t * sizeof(char *));
smlHead = (char *)calloc(HEAD_BUFF_LEN, 1);
if (NULL == smlHead) {
errorPrint2("calloc failed! size:%d\n", HEAD_BUFF_LEN);
exit(EXIT_FAILURE);
}
generateSmlHead(smlHead[t], stbInfo, pThreadInfo, t);
generateSmlHead(smlHead, stbInfo, pThreadInfo, t);
}
int currentPercent = 0;
......@@ -10499,7 +10502,7 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) {
errorPrint2("Failed to alloc %d bytes, reason:%s\n",
BUFFER_SIZE, strerror(errno));
}
generateSmlTail(pThreadInfo->lines[k], smlHead[i], stbInfo, pThreadInfo, timestamp);
generateSmlTail(pThreadInfo->lines[k], *((char**)smlHeadList + i * sizeof(char *)), stbInfo, pThreadInfo, timestamp);
timestamp += timeStampStep;
j++;
if (j == insertRows) {
......@@ -10555,8 +10558,9 @@ static void* syncWriteProgressiveSml(threadInfo *pThreadInfo) {
}
tmfree(pThreadInfo->lines);
for (int index = 0; index < pThreadInfo->ntables; index++) {
free(smlHead[index]);
free(*((char**)smlHeadList + index * sizeof(char *)));
}
tmfree(smlHeadList);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册