mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +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"
|
||||
"flag"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
@ -1312,9 +1311,11 @@ func canAppendToBlockRefPool(pool, a []blockRef) bool {
|
|||
// a doesn't belong to pool
|
||||
return false
|
||||
}
|
||||
shPool := (*reflect.SliceHeader)(unsafe.Pointer(&pool))
|
||||
shA := (*reflect.SliceHeader)(unsafe.Pointer(&a))
|
||||
return shPool.Data+uintptr(shPool.Len)*unsafe.Sizeof(blockRef{}) == shA.Data+uintptr(shA.Len)*unsafe.Sizeof(blockRef{})
|
||||
return getBlockRefsEnd(pool) == getBlockRefsEnd(a)
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue