https://github.com/JuliaLang/julia
Revision 92b210e151d186b7b6c16a6a36afbe7cfd98996d authored by Nathan Daly on 03 April 2024, 06:38:44 UTC, committed by Nathan Daly on 03 April 2024, 06:52:04 UTC
```
function my_hot_function(args...)
    # ...setup...
    x,y = 1, 2 # ...
    z = 0

    # hot regions must stay performant
    @enforce_stable begin
        for i in 1:1000
            # ...
            z = x + y + z
            # ...
            i % 100 == 0 && @allow_unstable @info "computed $z"
        end
    end

    return z
end
```
1 parent 718b988
History
Tip revision: 92b210e151d186b7b6c16a6a36afbe7cfd98996d authored by Nathan Daly on 03 April 2024, 06:38:44 UTC
Macro to enforce static code regions.
Tip revision: 92b210e
File Mode Size
man
src
.gitignore -rw-r--r-- 55 bytes
Makefile -rw-r--r-- 2.1 KB
Manifest.toml -rw-r--r-- 8.1 KB
NEWS-update.jl -rw-r--r-- 486 bytes
Project.toml -rw-r--r-- 59 bytes
README.md -rw-r--r-- 900 bytes
make.jl -rw-r--r-- 17.8 KB

README.md

back to top