mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
app/vmselect/netstorage: usae unsafe.SliceData instead of deprecated reflect.SliceHeader
This commit is contained in:
parent
6a8dc74ee7
commit
146fccc22d
1 changed files with 5 additions and 4 deletions
|
@ -5,7 +5,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
@ -1312,9 +1311,11 @@ func canAppendToBlockRefPool(pool, a []blockRef) bool {
|
||||||
// a doesn't belong to pool
|
// a doesn't belong to pool
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
shPool := (*reflect.SliceHeader)(unsafe.Pointer(&pool))
|
return getBlockRefsEnd(pool) == getBlockRefsEnd(a)
|
||||||
shA := (*reflect.SliceHeader)(unsafe.Pointer(&a))
|
}
|
||||||
return shPool.Data+uintptr(shPool.Len)*unsafe.Sizeof(blockRef{}) == shA.Data+uintptr(shA.Len)*unsafe.Sizeof(blockRef{})
|
|
||||||
|
func getBlockRefsEnd(a []blockRef) uintptr {
|
||||||
|
return uintptr(unsafe.Pointer(unsafe.SliceData(a))) + uintptr(len(a))*unsafe.Sizeof(blockRef{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupTfss(qt *querytracer.Tracer, tr storage.TimeRange, tagFilterss [][]storage.TagFilter, maxMetrics int, deadline searchutils.Deadline) ([]*storage.TagFilters, error) {
|
func setupTfss(qt *querytracer.Tracer, tr storage.TimeRange, tagFilterss [][]storage.TagFilter, maxMetrics int, deadline searchutils.Deadline) ([]*storage.TagFilters, error) {
|
||||||
|
|
Loading…
Reference in a new issue