提交 be050e12 编写于 作者: Y yihaoDeng

fix recover error

上级 d0ccbd48
...@@ -40,16 +40,8 @@ typedef struct { ...@@ -40,16 +40,8 @@ typedef struct {
rocksdb_comparator_t** pCompares; rocksdb_comparator_t** pCompares;
} RocksdbCfInst; } RocksdbCfInst;
uint32_t nextPow2(uint32_t x) { 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;
}
int32_t streamStateOpenBackendCf(void* backend, char* name, char** cfs, int32_t nCf); int32_t streamStateOpenBackendCf(void* backend, char* name, char** cfs, int32_t nCf);
void destroyRocksdbCfInst(RocksdbCfInst* inst); void destroyRocksdbCfInst(RocksdbCfInst* inst);
...@@ -2361,3 +2353,13 @@ int32_t streamStatePutBatch_rocksdb(SStreamState* pState, void* pBatch) { ...@@ -2361,3 +2353,13 @@ int32_t streamStatePutBatch_rocksdb(SStreamState* pState, void* pBatch) {
} }
return 0; 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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册