mirror of
https://github.com/arnaucube/arbo.git
synced 2026-01-15 01:41:28 +01:00
Update VT goroutines errs & Update Pack&UnpackSibl
- Update VT goroutines errs to avoid race condition - Update pack & unpack siblings to use 2-byte for full length & bitmap bytes length - Add check in UnpackSiblings to avoid panic
This commit is contained in:
4
vt.go
4
vt.go
@@ -176,7 +176,7 @@ func (t *vt) addBatch(ks, vs [][]byte) ([]int, error) {
|
||||
bucketVT := newVT(t.params.maxLevels, t.params.hashFunction)
|
||||
bucketVT.root = nodesAtL[cpu]
|
||||
for j := 0; j < len(buckets[cpu]); j++ {
|
||||
if err = bucketVT.add(l, buckets[cpu][j].k, buckets[cpu][j].v); err != nil {
|
||||
if err := bucketVT.add(l, buckets[cpu][j].k, buckets[cpu][j].v); err != nil {
|
||||
invalidsInBucket[cpu] = append(invalidsInBucket[cpu], buckets[cpu][j].pos)
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ func (t *vt) computeHashes() ([][2][]byte, error) {
|
||||
bucketVT := newVT(t.params.maxLevels, t.params.hashFunction)
|
||||
bucketVT.params.dbg = newDbgStats()
|
||||
bucketVT.root = nodesAtL[cpu]
|
||||
|
||||
var err error
|
||||
bucketPairs[cpu], err = bucketVT.root.computeHashes(l-1,
|
||||
t.params.maxLevels, bucketVT.params, bucketPairs[cpu])
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user