We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
random
1 parent ba3d210 commit ac1722aCopy full SHA for ac1722a
test/random.jl
@@ -275,8 +275,14 @@ let mt = MersenneTwister()
275
a = Array(Float64, 0)
276
resize!(a, 1000) # could be 8-byte aligned
277
b = Array(Float64, 1000) # should be 16-byte aligned
278
- c8 = Array(UInt8, 8001)
279
- c = pointer_to_array(Ptr{Float64}(pointer(c8, 2)), 1000) # Int(pointer(c)) % 16 == 1
+ c8 = Array(UInt64, 1000)
+ pc8 = pointer(c8)
280
+ if Int(pc8) % 16 == 0
281
+ pc8 += 8 # Make sure pc8 is not 16-byte aligned
282
+ # It still has to be 8-byte aligned since it is otherwise invalid
283
+ # on certain architectures (e.g. ARM)
284
+ end
285
+ c = pointer_to_array(Ptr{Float64}(pc8), 1000) # Int(pointer(c)) % 16 == 8
286
287
for A in (a, b, c)
288
srand(mt, 0)
0 commit comments