mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
HyperLogLog: enlarge reghisto variable for safety.
This commit is contained in:
parent
4208666797
commit
a4b90be9fc
@ -1017,7 +1017,12 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
|
|||||||
double m = HLL_REGISTERS;
|
double m = HLL_REGISTERS;
|
||||||
double E;
|
double E;
|
||||||
int j;
|
int j;
|
||||||
int reghisto[HLL_Q+2] = {0};
|
/* Note that reghisto could be just HLL_Q+1, becuase this is the
|
||||||
|
* maximum frequency of the "000...1" sequence the hash function is
|
||||||
|
* able to return. However it is slow to check for sanity of the
|
||||||
|
* input: instead we history array at a safe size: overflows will
|
||||||
|
* just write data to wrong, but correctly allocated, places. */
|
||||||
|
int reghisto[64] = {0};
|
||||||
|
|
||||||
/* Compute register histogram */
|
/* Compute register histogram */
|
||||||
if (hdr->encoding == HLL_DENSE) {
|
if (hdr->encoding == HLL_DENSE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user