Lines Matching refs:hdr

191 #define HLL_INVALIDATE_CACHE(hdr) (hdr)->card[7] |= (1<<7)  argument
192 #define HLL_VALID_CACHE(hdr) (((hdr)->card[7] & (1<<7)) == 0) argument
570 struct hllhdr *hdr, *oldhdr = (struct hllhdr*)sparse; in hllSparseToDense() local
575 hdr = (struct hllhdr*) sparse; in hllSparseToDense()
576 if (hdr->encoding == HLL_DENSE) return C_OK; in hllSparseToDense()
582 hdr = (struct hllhdr*) dense; in hllSparseToDense()
583 *hdr = *oldhdr; /* This will copy the magic and cached cardinality. */ in hllSparseToDense()
584 hdr->encoding = HLL_DENSE; in hllSparseToDense()
602 HLL_DENSE_SET_REGISTER(hdr->registers,idx,regval); in hllSparseToDense()
639 struct hllhdr *hdr; in hllSparseAdd() local
864 hdr = o->ptr; in hllSparseAdd()
865 HLL_INVALIDATE_CACHE(hdr); in hllSparseAdd()
870 hdr = o->ptr; in hllSparseAdd()
879 int dense_retval = hllDenseAdd(hdr->registers, ele, elesize); in hllSparseAdd()
967 uint64_t hllCount(struct hllhdr *hdr, int *invalid) { in hllCount() argument
986 if (hdr->encoding == HLL_DENSE) { in hllCount()
987 E = hllDenseSum(hdr->registers,PE,&ez); in hllCount()
988 } else if (hdr->encoding == HLL_SPARSE) { in hllCount()
989 E = hllSparseSum(hdr->registers, in hllCount()
990 sdslen((sds)hdr)-HLL_HDR_SIZE,PE,&ez,invalid); in hllCount()
991 } else if (hdr->encoding == HLL_RAW) { in hllCount()
992 E = hllRawSum(hdr->registers,PE,&ez); in hllCount()
1028 struct hllhdr *hdr = o->ptr; in hllAdd() local
1029 switch(hdr->encoding) { in hllAdd()
1030 case HLL_DENSE: return hllDenseAdd(hdr->registers,ele,elesize); in hllAdd()
1045 struct hllhdr *hdr = hll->ptr; in hllMerge() local
1048 if (hdr->encoding == HLL_DENSE) { in hllMerge()
1052 HLL_DENSE_GET_REGISTER(val,hdr->registers,i); in hllMerge()
1091 struct hllhdr *hdr; in createHLLObject() local
1115 hdr = o->ptr; in createHLLObject()
1116 memcpy(hdr->magic,"HYLL",4); in createHLLObject()
1117 hdr->encoding = HLL_SPARSE; in createHLLObject()
1125 struct hllhdr *hdr; in isHLLObjectOrReply() local
1131 if (stringObjectLen(o) < sizeof(*hdr)) goto invalid; in isHLLObjectOrReply()
1132 hdr = o->ptr; in isHLLObjectOrReply()
1135 if (hdr->magic[0] != 'H' || hdr->magic[1] != 'Y' || in isHLLObjectOrReply()
1136 hdr->magic[2] != 'L' || hdr->magic[3] != 'L') goto invalid; in isHLLObjectOrReply()
1138 if (hdr->encoding > HLL_MAX_ENCODING) goto invalid; in isHLLObjectOrReply()
1141 if (hdr->encoding == HLL_DENSE && in isHLLObjectOrReply()
1157 struct hllhdr *hdr; in pfaddCommand() local
1184 hdr = o->ptr; in pfaddCommand()
1189 HLL_INVALIDATE_CACHE(hdr); in pfaddCommand()
1197 struct hllhdr *hdr; in pfcountCommand() local
1210 hdr = (struct hllhdr*) max; in pfcountCommand()
1211 hdr->encoding = HLL_RAW; /* Special internal-only encoding. */ in pfcountCommand()
1228 addReplyLongLong(c,hllCount(hdr,NULL)); in pfcountCommand()
1246 hdr = o->ptr; in pfcountCommand()
1247 if (HLL_VALID_CACHE(hdr)) { in pfcountCommand()
1249 card = (uint64_t)hdr->card[0]; in pfcountCommand()
1250 card |= (uint64_t)hdr->card[1] << 8; in pfcountCommand()
1251 card |= (uint64_t)hdr->card[2] << 16; in pfcountCommand()
1252 card |= (uint64_t)hdr->card[3] << 24; in pfcountCommand()
1253 card |= (uint64_t)hdr->card[4] << 32; in pfcountCommand()
1254 card |= (uint64_t)hdr->card[5] << 40; in pfcountCommand()
1255 card |= (uint64_t)hdr->card[6] << 48; in pfcountCommand()
1256 card |= (uint64_t)hdr->card[7] << 56; in pfcountCommand()
1260 card = hllCount(hdr,&invalid); in pfcountCommand()
1265 hdr->card[0] = card & 0xff; in pfcountCommand()
1266 hdr->card[1] = (card >> 8) & 0xff; in pfcountCommand()
1267 hdr->card[2] = (card >> 16) & 0xff; in pfcountCommand()
1268 hdr->card[3] = (card >> 24) & 0xff; in pfcountCommand()
1269 hdr->card[4] = (card >> 32) & 0xff; in pfcountCommand()
1270 hdr->card[5] = (card >> 40) & 0xff; in pfcountCommand()
1271 hdr->card[6] = (card >> 48) & 0xff; in pfcountCommand()
1272 hdr->card[7] = (card >> 56) & 0xff; in pfcountCommand()
1287 struct hllhdr *hdr; in pfmergeCommand() local
1331 hdr = o->ptr; in pfmergeCommand()
1333 HLL_DENSE_SET_REGISTER(hdr->registers,j,max[j]); in pfmergeCommand()
1335 HLL_INVALIDATE_CACHE(hdr); in pfmergeCommand()
1354 struct hllhdr *hdr = (struct hllhdr*) bitcounters, *hdr2; in pfselftestCommand() local
1369 HLL_DENSE_SET_REGISTER(hdr->registers,i,r); in pfselftestCommand()
1375 HLL_DENSE_GET_REGISTER(val,hdr->registers,i); in pfselftestCommand()
1395 memset(hdr->registers,0,HLL_DENSE_SIZE-HLL_HDR_SIZE); in pfselftestCommand()
1403 hllDenseAdd(hdr->registers,(unsigned char*)&ele,sizeof(ele)); in pfselftestCommand()
1417 if (j == checkpoint && hllCount(hdr,NULL) != hllCount(o->ptr,NULL)) { in pfselftestCommand()
1424 int64_t abserr = checkpoint - (int64_t)hllCount(hdr,NULL); in pfselftestCommand()
1457 struct hllhdr *hdr; in pfdebugCommand() local
1468 hdr = o->ptr; in pfdebugCommand()
1474 if (hdr->encoding == HLL_SPARSE) { in pfdebugCommand()
1482 hdr = o->ptr; in pfdebugCommand()
1487 HLL_DENSE_GET_REGISTER(val,hdr->registers,j); in pfdebugCommand()
1498 if (hdr->encoding != HLL_SPARSE) { in pfdebugCommand()
1531 addReplyStatus(c,encodingstr[hdr->encoding]); in pfdebugCommand()
1538 if (hdr->encoding == HLL_SPARSE) { in pfdebugCommand()