diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 8076fec..1c14347 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.0-rc1","generation_timestamp":"2023-11-06T17:17:07","documenter_version":"1.1.2"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0-rc1","generation_timestamp":"2023-11-13T19:44:58","documenter_version":"1.1.2"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index dcf61b6..be2ff53 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -6,4 +6,4 @@ foo (generic function with 1 method) julia> allocs = check_allocs(foo, (Int, Int)) -AllocCheck.AllocInstance[]source +AllocCheck.AllocInstance[]source diff --git a/dev/index.html b/dev/index.html index 32c1d3b..38652ca 100644 --- a/dev/index.html +++ b/dev/index.html @@ -21,4 +21,4 @@ @ LinearAlgebra /opt/hostedtoolcache/julia/1.10.0-rc1/x64/share/julia/stdlib/v1.10/LinearAlgebra/src/generic.jl:1118 [6] linsolve(a::Matrix{Float64}, b::Vector{Float64}) @ Main ./index.md:21 -

we see what type of object was allocated, and where in the code the allocation appeared.

Functions that throw exceptions

Some functions that we do not expect may allocate memory, like sin, actually may:

length(check_allocs(sin, (Float64,)))
0

The reason for this is that sin may throw an error, and the exception object requires some allocations. We can ignore allocations that only happen when throwing errors by passing ignore_throw=true:

length(check_allocs(sin, (Float64,); ignore_throw=true)) # ignore allocations that only happen when throwing errors
0

Limitations

  1. Runtime dispatch

Any runtime dispatch is conservatively assumed to allocate.

+

we see what type of object was allocated, and where in the code the allocation appeared.

Functions that throw exceptions

Some functions that we do not expect may allocate memory, like sin, actually may:

length(check_allocs(sin, (Float64,)))
0

The reason for this is that sin may throw an error, and the exception object requires some allocations. We can ignore allocations that only happen when throwing errors by passing ignore_throw=true:

length(check_allocs(sin, (Float64,); ignore_throw=true)) # ignore allocations that only happen when throwing errors
0

Limitations

  1. Runtime dispatch

Any runtime dispatch is conservatively assumed to allocate.