We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func (b *bucket) Set(k, v []byte, h uint64) { ... b.mu.Lock() idx := b.idx idxNew := idx + kvLen chunkIdx := idx / chunkSize chunkIdxNew := idxNew / chunkSize if chunkIdxNew > chunkIdx { if chunkIdxNew >= uint64(len(b.chunks)) { idx = 0 idxNew = kvLen chunkIdx = 0 b.gen++ if b.gen&((1<<genSizeBits)-1) == 0 { b.gen++ } } else { //actually idx = idxNew idx = chunkIdxNew * chunkSize //bug here: repeat set idxNew = chunkIdxNew * chunkSize + kvlen idxNew = idx + kvLen chunkIdx = chunkIdxNew } b.chunks[chunkIdx] = b.chunks[chunkIdx][:0] } ... // set idxNew b.idx = idxNew }
i mark the bug in the comment. In the else block repeat set idxNew cause need to waste kvLen bytes memory.
The text was updated successfully, but these errors were encountered:
forget it
Sorry, something went wrong.
No branches or pull requests
i mark the bug in the comment. In the else block repeat set idxNew cause need to waste kvLen bytes memory.
The text was updated successfully, but these errors were encountered: