disable talloc2 on 32 bits (#10656)

This commit is contained in:
Arne Döring 2019-02-13 08:04:06 +01:00 • committed by Andreas Rumpf
commit b6c22eae6a

View file

@ -1,16 +1,15 @@
discard """ discard """
disabled: "windows" disabled: "windows"
joinable: false joinable: false
disabled: 32bit
""" """
# no point to test this on system with smaller address space
# appveyor is "out of memory" # appveyor is "out of memory"
when sizeof(int) >= 8: const
# no point to test this on system with smaller address space
const
nmax = 2*1024*1024*1024 nmax = 2*1024*1024*1024
proc test(n: int) = proc test(n: int) =
var a = alloc0(9999) var a = alloc0(9999)
var t = cast[ptr UncheckedArray[int8]](alloc(n)) var t = cast[ptr UncheckedArray[int8]](alloc(n))
var b = alloc0(9999) var b = alloc0(9999)
@ -22,9 +21,9 @@ when sizeof(int) >= 8:
dealloc(t) dealloc(t)
dealloc(b) dealloc(b)
# allocator adds 48 bytes to BigChunk # allocator adds 48 bytes to BigChunk
# BigChunk allocator edges at 2^n * (1 - s) for s = [1..32]/64 # BigChunk allocator edges at 2^n * (1 - s) for s = [1..32]/64
proc test2(n: int) = proc test2(n: int) =
let d = n div 256 # cover edges and more let d = n div 256 # cover edges and more
for i in countdown(128,1): for i in countdown(128,1):
for j in [-4096, -64, -49, -48, -47, -32, 0, 4096]: for j in [-4096, -64, -49, -48, -47, -32, 0, 4096]:
@ -33,7 +32,7 @@ when sizeof(int) >= 8:
test(b) test(b)
#echo b, ": ", getTotalMem(), " ", getOccupiedMem(), " ", getFreeMem() #echo b, ": ", getTotalMem(), " ", getOccupiedMem(), " ", getFreeMem()
proc test3 = proc test3 =
var n = 1 var n = 1
while n <= nmax: while n <= nmax:
test2(n) test2(n)
@ -43,4 +42,4 @@ when sizeof(int) >= 8:
test2(n) test2(n)
n = n div 2 n = n div 2
test3() test3()