more
This commit is contained in:
parent
29e4a61baa
commit
fd9feb1ac5
|
@ -27,8 +27,11 @@
|
||||||
|
|
||||||
#define tPutC(buf, val) \
|
#define tPutC(buf, val) \
|
||||||
({ \
|
({ \
|
||||||
|
if (buf) { \
|
||||||
((uint64_t *)buf)[0] = (val); \
|
((uint64_t *)buf)[0] = (val); \
|
||||||
POINTER_SHIFT(buf, sizeof(val)); \
|
POINTER_SHIFT(buf, sizeof(val)); \
|
||||||
|
} \
|
||||||
|
NULL; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define tPutD(buf, val) \
|
#define tPutD(buf, val) \
|
||||||
|
@ -41,7 +44,14 @@
|
||||||
POINTER_SHIFT(buf, sizeof(val)); \
|
POINTER_SHIFT(buf, sizeof(val)); \
|
||||||
})
|
})
|
||||||
|
|
||||||
typedef enum { A, B, C, D } T;
|
static inline void tPutE(void **buf, uint64_t val) {
|
||||||
|
if (buf) {
|
||||||
|
((uint64_t *)(*buf))[0] = val;
|
||||||
|
*buf = POINTER_SHIFT(*buf, sizeof(val));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef enum { A, B, C, D, E } T;
|
||||||
|
|
||||||
static void func(T t) {
|
static void func(T t) {
|
||||||
uint64_t val = 198;
|
uint64_t val = 198;
|
||||||
|
@ -81,6 +91,14 @@ static void func(T t) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case E:
|
||||||
|
for (size_t i = 0; i < 10 * 1024l * 1024l * 1024l; i++) {
|
||||||
|
tPutE(&pBuf, val);
|
||||||
|
if (POINTER_DISTANCE(buf, pBuf) == 1024) {
|
||||||
|
pBuf = buf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -108,5 +126,8 @@ int main(int argc, char const *argv[]) {
|
||||||
func(D);
|
func(D);
|
||||||
uint64_t t5 = now();
|
uint64_t t5 = now();
|
||||||
printf("D: %ld\n", t5 - t4);
|
printf("D: %ld\n", t5 - t4);
|
||||||
|
func(E);
|
||||||
|
uint64_t t6 = now();
|
||||||
|
printf("E: %ld\n", t6 - t5);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,10 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "vnodeDef.h"
|
|
||||||
#include "vnodeQuery.h"
|
#include "vnodeQuery.h"
|
||||||
|
#include "vnodeDef.h"
|
||||||
|
|
||||||
int vnodeQueryOpen(SVnode *pVnode) {
|
int vnodeQueryOpen(SVnode *pVnode) { return qWorkerInit(NULL, &pVnode->pQuery); }
|
||||||
return qWorkerInit(NULL, &pVnode->pQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
int vnodeProcessQueryReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
int vnodeProcessQueryReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
vInfo("query message is processed");
|
vInfo("query message is processed");
|
||||||
|
@ -32,4 +30,8 @@ int vnodeProcessFetchReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
|
STableInfoMsg *pReq = (STableInfoMsg *)(pMsg->pCont);
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue