Skip to content

Commit e86becb

Browse files
see if full specialize helps
1 parent fe06559 commit e86becb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ julia = "1.10"
147147

148148
[extras]
149149
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
150-
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
151150
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
152151
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
153152
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
@@ -172,4 +171,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
172171
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
173172

174173
[targets]
175-
test = ["Calculus", "AllocCheck", "ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "InteractiveUtils", "ParameterizedFunctions", "PoissonRandom", "Printf", "Random", "ReverseDiff", "SafeTestsets", "SparseArrays", "Statistics", "Test", "Unitful", "ModelingToolkit", "Pkg", "NLsolve"]
174+
test = ["Calculus", "ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "InteractiveUtils", "ParameterizedFunctions", "PoissonRandom", "Printf", "Random", "ReverseDiff", "SafeTestsets", "SparseArrays", "Statistics", "Test", "Unitful", "ModelingToolkit", "Pkg", "NLsolve"]

test/integrators/callback_allocation_tests.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using OrdinaryDiffEq, Test
2-
using OrdinaryDiffEqCore, AllocCheck
2+
using OrdinaryDiffEqCore
33

44
# Setup a simple ODE problem with several callbacks (to test LLVM code gen)
55
# We will manually trigger the first callback and check its allocations.
@@ -32,15 +32,17 @@ cbs = CallbackSet(ContinuousCallback(cond_1, cb_affect!),
3232
ContinuousCallback(cond_9, cb_affect!))
3333

3434
integrator = init(
35-
ODEProblem(f!, [0.8, 1.0], (0.0, 100.0), [0, 0]), Tsit5(), callback = cbs,
35+
ODEProblem{true, SciMLBase.FullSpecialize}(f!, [0.8, 1.0],
36+
(0.0, 100.0), [0, 0]), Tsit5(), callback = cbs,
3637
save_on = false);
3738
# Force a callback event to occur so we can call handle_callbacks! directly.
3839
# Step to a point where u[1] is still > 0.5, so we can force it below 0.5 and
3940
# call handle callbacks
4041
step!(integrator, 0.1, true)
4142

42-
@check_allocs function handle_allocs(integrator)
43+
function handle_allocs(integrator)
4344
integrator.u[1] = 0.4
44-
OrdinaryDiffEqCore.handle_callbacks!(integrator)
45+
@allocations OrdinaryDiffEqCore.handle_callbacks!(integrator)
4546
end
46-
handle_allocs(integrator)
47+
handle_allocs(integrator)
48+
@test handle_allocs(integrator) == 0

0 commit comments

Comments
 (0)