diff --git a/test/blockmap.jl b/test/blockmap.jl index 36c016f6..d938e7e4 100644 --- a/test/blockmap.jl +++ b/test/blockmap.jl @@ -290,7 +290,7 @@ using LinearMaps: FiveArg @test mul!(copy(v), LinearMap(transform(L)), u, α, β) ≈ transform(M)*u*α + v*β if transform != adjoint transL = transform(L) - alloc = @allocated similar(v) + alloc = sizeof(v) + 64 if L == L2 && α != false @test_broken (@allocated mul!(v, transL, u, α, β)) <= alloc else diff --git a/test/functionmap.jl b/test/functionmap.jl index 16b3c5de..f84aecb1 100644 --- a/test/functionmap.jl +++ b/test/functionmap.jl @@ -87,7 +87,7 @@ using Test, LinearMaps, LinearAlgebra @test mul!(copy(v), LinearMap(transform(CS!)), u, α, β) ≈ transform(M)*u*α + v*β if transform != transpose transCS! = transform(CS!) - alloc = @allocated similar(v) + alloc = sizeof(v) + 64 @test (@allocated mul!(v, transCS!, u, α, β)) <= alloc end end diff --git a/test/linearcombination.jl b/test/linearcombination.jl index 19a1c5c7..85e87801 100644 --- a/test/linearcombination.jl +++ b/test/linearcombination.jl @@ -12,7 +12,7 @@ using LinearMaps: FiveArg, LinearMapTuple, LinearMapVector, FunctionMap mul!(u, CS!, v) @test (@allocated mul!(u, CS!, v)) == 0 n = 10 - alloc = @allocated similar(v) + alloc = sizeof(v) + 64 Loop = @inferred CS + CS + CS @test Loop * v ≈ 3cumsum(v) @test (CS + CR + CS) * v ≈ 3cumsum(v) @@ -60,7 +60,7 @@ using LinearMaps: FiveArg, LinearMapTuple, LinearMapVector, FunctionMap @test occursin("10×10 $LinearMaps.LinearCombination{$(eltype(L))}", sprint((t, s) -> show(t, "text/plain", s), L+CS!)) @test mul!(u, L, v) ≈ n * cumsum(v) @test mul!(u, Lv, v) ≈ n * cumsum(v) - alloc = @allocated similar(u) + alloc = sizeof(u) + 64 mul!(u, L, v, 2, 2) @test (@allocated mul!(u, L, v, 2, 2)) <= alloc mul!(u, Lv, v, 2, 2) diff --git a/test/scaledmap.jl b/test/scaledmap.jl index 8a35f27e..add92589 100644 --- a/test/scaledmap.jl +++ b/test/scaledmap.jl @@ -104,7 +104,7 @@ using Test, LinearMaps, LinearAlgebra for (A, alloc) in ((A0, 1), (A1, 0), (B0, 1), (B1, 0), (A0', 3), (A1', 0), (B0', 3), (B1', 0)) x = rand(N) y = similar(x) - allocsize = @allocated similar(y) + allocsize = sizeof(y)+72 mul!(y, A, x) @test (@allocated mul!(y, A, x)) == alloc*allocsize end