app/vmselect/promql: use universal approach for determining maxByteSliceLen on 32-bit and 64-bit archs

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/235
This commit is contained in:
Aliaksandr Valialkin 2019-11-13 20:21:21 +02:00
parent d297b65089
commit c33640664a
4 changed files with 5 additions and 9 deletions

View file

@ -0,0 +1,5 @@
package promql
import "unsafe"
const maxByteSliceLen = 1<<(31+9*(unsafe.Sizeof(int(0))/8)) - 1

View file

@ -1,3 +0,0 @@
package promql
const maxByteSliceLen = 1<<31 - 1

View file

@ -1,3 +0,0 @@
package promql
const maxByteSliceLen = 1 << 40

View file

@ -1,3 +0,0 @@
package promql
const maxByteSliceLen = 1<<31 - 1