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

This commit is contained in:
Haojun Liao 2022-11-25 22:54:54 +08:00
parent 7fe4cf7bbe
commit d77f5fa70c
4 changed files with 9 additions and 8 deletions

View File

@ -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>

View File

@ -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);
/**
*

View File

@ -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
}

View File

@ -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;