on master help sign in
Touch buffers at offset 63M instead of 0.
3f3da25Matus Tejiscak
test/primitives006/load-test.idr+5−4
@@ -3,6 +3,7 @@ module Main
3import Data.Bytes as B
3import Data.Bytes as B
4import Data.ByteArray as BA
4import Data.ByteArray as BA
5
5
6+-- %flag C "-g3 -ggdb -O0"
6%link C "array.o"
7%link C "array.o"
7
8
8initialBuf : Bytes
9initialBuf : Bytes
@@ -29,10 +30,10 @@ alloc x 0 = return x
29alloc x i = do
30alloc x i = do
30 -- allocate an array
31 -- allocate an array
31 arr <- BA.allocate (64 * 1024 * 1024)
32 arr <- BA.allocate (64 * 1024 * 1024)
32− -- write "i" at offset 0
33+ -- write "i" at offset 63M
33− BA.pokeInt 0 i arr
34+ BA.pokeInt (63*1024*1024) i arr
34− -- read number from offset 0
35+ -- read number from offset 63M
35− j <- BA.peekInt 0 arr
36+ j <- BA.peekInt (63*1024*1024) arr
36 -- count matches
37 -- count matches
37 alloc (x + if i == j then 1 else 0) (i - 1)
38 alloc (x + if i == j then 1 else 0) (i - 1)
38
39