[ANN] AllocCheck.jl: Static code analysis to prove allocation-free behavior

ChrisRackauckas
Sat, 18 Nov 2023 18:08:29 +0000
Package Announcements

JuliaHub is happy to announce a new open source tool for static code analysis to prove that a Julia function is allocation-free. Use this to ensure that codes are safe for real-time applications, such as how we use it for JuliaSim to analyze SciML control codes!

The primary entry point to check allocations is the macro @check_allocs which is used to annotate a function definition that you’d like to enforce allocation checks for:

julia> using AllocCheck

julia> @check_allocs multiply(x,y) = x * y
multiply (generic function with 1 method)

julia> multiply(1.5, 2.5) # call automatically checked for allocations
3.75

julia> multiply(rand(3,3), rand(3,3)) # result matrix requires an allocation
ERROR: @check_alloc function encountered 1 errors (1 allocations / 0 dynamic dispatches).

To use it, check out the repository in JuliaLang:

GitHub

GitHub - JuliaLang/AllocCheck.jl: AllocCheck

AllocCheck. Contribute to JuliaLang/AllocCheck.jl development by creating an account on GitHub.

For more on how Julia is developing for real-time controls applications, check out JuliaSim:

juliahub.com

JuliaSim - JuliaHub

JuliaSim - JuliaHub

Please give all of the credit to the real developers, Cody Tapscott and @gbaraldi.

28 posts - 15 participants