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