fix recover error

This commit is contained in:
yihaoDeng 2023-07-14 15:46:00 +08:00
parent d0ccbd48d2
commit be050e12ea
1 changed files with 12 additions and 10 deletions

View File

@ -40,16 +40,8 @@ typedef struct {
rocksdb_comparator_t** pCompares;
} RocksdbCfInst;
uint32_t nextPow2(uint32_t x) {
if (x <= 1) return 2;
x = x - 1;
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >> 16);
return x + 1;
}
uint32_t nextPow2(uint32_t x);
int32_t streamStateOpenBackendCf(void* backend, char* name, char** cfs, int32_t nCf);
void destroyRocksdbCfInst(RocksdbCfInst* inst);
@ -2361,3 +2353,13 @@ int32_t streamStatePutBatch_rocksdb(SStreamState* pState, void* pBatch) {
}
return 0;
}
uint32_t nextPow2(uint32_t x) {
if (x <= 1) return 2;
x = x - 1;
x = x | (x >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >> 16);
return x + 1;
}