提交 d77f5fa7 编写于 作者: H Haojun Liao

fix(query): fix error in windows and darwin system.

上级 7fe4cf7b
......@@ -43,6 +43,7 @@ extern "C" {
#include <sys/utsname.h>
#include <sys/wait.h>
#include <termios.h>
#include <cpuid.h>
#if defined(DARWIN)
#else
......@@ -81,7 +82,6 @@ extern "C" {
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#include <cpuid.h>
#if __AVX__
#include <immintrin.h>
......
......@@ -24,12 +24,9 @@
extern "C" {
#endif
typedef struct SArray* SIDList;
typedef struct SPageInfo SPageInfo;
typedef struct SDiskbasedBuf SDiskbasedBuf;
#define DEFAULT_INTERN_BUF_PAGE_SIZE (1024LL) // in bytes
typedef struct SFilePage {
int32_t num;
char data[];
......@@ -69,7 +66,7 @@ void* getNewBufPage(SDiskbasedBuf* pBuf, int32_t* pageId);
* @param pBuf
* @return
*/
SIDList getDataBufPagesIdList(SDiskbasedBuf* pBuf);
SArray* getDataBufPagesIdList(SDiskbasedBuf* pBuf);
/**
* get the specified buffer page by id
......@@ -111,7 +108,7 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf);
* @param pList
* @return
*/
SPageInfo* getLastPageInfo(SIDList pList);
SPageInfo* getLastPageInfo(SArray* pList);
/**
*
......
......@@ -350,6 +350,10 @@ void* taosMemoryMallocAlign(uint32_t alignment, int64_t size) {
#ifdef USE_TD_MEMORY
ASSERT(0);
#else
#if defined(LINUX)
return memalign(alignment, size);
#else
return taosMemoryMalloc(size);
#endif
#endif
}
......@@ -495,7 +495,7 @@ void releaseBufPageInfo(SDiskbasedBuf* pBuf, SPageInfo* pi) {
size_t getTotalBufSize(const SDiskbasedBuf* pBuf) { return (size_t)pBuf->totalBufSize; }
SIDList getDataBufPagesIdList(SDiskbasedBuf* pBuf) {
SArray* getDataBufPagesIdList(SDiskbasedBuf* pBuf) {
ASSERT(pBuf != NULL);
return pBuf->pIdList;
}
......@@ -561,7 +561,7 @@ void destroyDiskbasedBuf(SDiskbasedBuf* pBuf) {
taosMemoryFreeClear(pBuf);
}
SPageInfo* getLastPageInfo(SIDList pList) {
SPageInfo* getLastPageInfo(SArray* pList) {
size_t size = taosArrayGetSize(pList);
SPageInfo* pPgInfo = taosArrayGetP(pList, size - 1);
return pPgInfo;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册