refactor: add an assert.
This commit is contained in:
parent
85c1e3aabf
commit
fa43f86fe1
|
@ -1191,7 +1191,6 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo*
|
||||||
int32_t oldLen = BitmapLen(existedRows);
|
int32_t oldLen = BitmapLen(existedRows);
|
||||||
pColumn->nullbitmap = tmp;
|
pColumn->nullbitmap = tmp;
|
||||||
memset(&pColumn->nullbitmap[oldLen], 0, BitmapLen(numOfRows) - oldLen);
|
memset(&pColumn->nullbitmap[oldLen], 0, BitmapLen(numOfRows) - oldLen);
|
||||||
|
|
||||||
ASSERT(pColumn->info.bytes);
|
ASSERT(pColumn->info.bytes);
|
||||||
|
|
||||||
// make sure the allocated memory is MALLOC_ALIGN_BYTES aligned
|
// make sure the allocated memory is MALLOC_ALIGN_BYTES aligned
|
||||||
|
@ -1207,6 +1206,8 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo*
|
||||||
}
|
}
|
||||||
|
|
||||||
pColumn->pData = tmp;
|
pColumn->pData = tmp;
|
||||||
|
ASSERT((((uint64_t)pColumn->pData) & (MALLOC_ALIGN_BYTES - 1)) == 0x0);
|
||||||
|
|
||||||
if (clearPayload) {
|
if (clearPayload) {
|
||||||
memset(tmp + pColumn->info.bytes * existedRows, 0, pColumn->info.bytes * (numOfRows - existedRows));
|
memset(tmp + pColumn->info.bytes * existedRows, 0, pColumn->info.bytes * (numOfRows - existedRows));
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,8 +352,6 @@ void* taosMemoryMallocAlign(uint32_t alignment, int64_t size) {
|
||||||
#else
|
#else
|
||||||
#if defined(LINUX)
|
#if defined(LINUX)
|
||||||
void* p = memalign(alignment, size);
|
void* p = memalign(alignment, size);
|
||||||
ASSERT((((uint64_t)p) & (alignment - 1)) == 0x0);
|
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
#else
|
#else
|
||||||
return taosMemoryMalloc(size);
|
return taosMemoryMalloc(size);
|
||||||
|
|
Loading…
Reference in New Issue