提交 577ebfeb 编写于 作者: dengyihao's avatar dengyihao

fix compile error

上级 d00158ff
...@@ -561,8 +561,8 @@ int tfileWriterPut(TFileWriter* tw, void* data, bool order) { ...@@ -561,8 +561,8 @@ int tfileWriterPut(TFileWriter* tw, void* data, bool order) {
} }
tfileWriteFstOffset(tw, fstOffset); tfileWriteFstOffset(tw, fstOffset);
int32_t bufCap = 8 * 1024; int32_t cap = 4 * 1024;
char* buf = taosMemoryCalloc(1, bufCap); char* buf = taosMemoryCalloc(1, cap);
for (size_t i = 0; i < sz; i++) { for (size_t i = 0; i < sz; i++) {
TFileValue* v = taosArrayGetP((SArray*)data, i); TFileValue* v = taosArrayGetP((SArray*)data, i);
...@@ -571,16 +571,16 @@ int tfileWriterPut(TFileWriter* tw, void* data, bool order) { ...@@ -571,16 +571,16 @@ int tfileWriterPut(TFileWriter* tw, void* data, bool order) {
// check buf has enough space or not // check buf has enough space or not
int32_t ttsz = TF_TABLE_TATOAL_SIZE(tbsz); int32_t ttsz = TF_TABLE_TATOAL_SIZE(tbsz);
if (bufCap < ttsz) { if (cap < ttsz) {
bufCap = ttsz; cap = ttsz;
buf = taosMemoryRealloc(buf, bufCap); buf = (char*)taosMemoryRealloc(buf, cap);
} }
char* p = buf; char* p = buf;
tfileSerialTableIdsToBuf(p, v->tableId); tfileSerialTableIdsToBuf(p, v->tableId);
tw->ctx->write(tw->ctx, buf, ttsz); tw->ctx->write(tw->ctx, buf, ttsz);
v->offset = tw->offset; v->offset = tw->offset;
tw->offset += ttsz; tw->offset += ttsz;
memset(buf, 0, sizeof(buf)); memset(buf, 0, cap);
} }
taosMemoryFree(buf); taosMemoryFree(buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册