olint
olint reads an Odin project with core:odin/parser, builds its call graph and package import graph, and checks what the code promises: @zero_alloc and @no_temp_alloc, how context.temp_allocator is used, which packages may import which, and large values copied by accident. It never compiles or runs the project, and it uses only base: and core: packages.
It's the static half of obench. obench checks @zero_alloc at runtime on the inputs a benchmark runs, and olint checks the same annotation on every call path it can resolve.
Install
olint needs Odin dev-2026-10 or newer. Build the CLI from a clone, or take a prebuilt one from a release:
odin build cmd/olint -out:bin/olint -o:speedA finding
Run it on any Odin project, with no imports or changes to the source:
./bin/olint path/to/projectMark a hot-path procedure with // @zero_alloc, or pass -e <proc>. When it reaches an allocation several calls deep, across packages, olint prints the shortest call chain from the procedure to the allocating call. olint examples/game_loop -e step_world_leaky on an Apple M2:
olint: game_loop (darwin/arm64, 2 package(s), 2 file(s), 6 proc(s) analyzed in 1.99 ms)
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
rule │ severity │ location │ finding
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
alloc/zero-alloc │ ERROR │ sim/sim.odin:35:1 │ sim.step_world_leaky (@zero_alloc) allocates on context.allocator
├─► sim.step_world_leaky (sim/sim.odin:37:2) ── calls physics.solve_contacts_debug
├─► physics.solve_contacts_debug (physics/physics.odin:30:10) ── calls physics.format_contact_tag
╰─► physics.format_contact_tag (physics/physics.odin:36:9) ── calls fmt.aprintf (heap string formatting [heap: context.allocator])
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
FAIL: 1 error(s), 0 warning(s), 0 parse error(s) across 2 package(s)Allocations follow context. If the caller sets context.allocator = mem.arena_allocator(&arena) before the call, the callee's make goes to the arena and isn't reported. olint rules lists the built-in rules.
olint is before 1.0, so the API and the JSON report can still change, and the release notes list every breaking change. It's under the BSD-3-Clause licence.