perf: inline the per-allocation heartbeat increment Every small-object allocation called out to `lean_inc_heartbeat` just to bump a thread-local counter, which showed up as 1.8% of cycles on the `simp_local` elaboration benchmark. The counter is now declared in `lean.h` with the `initial-exec` TLS model, so `lean_alloc_small_object` increments it directly: a call plus six instructions per allocation becomes a single `incq %fs:(reg)`, and the compiler hoists the thread-pointer load so that all allocations in a function share it. About 168k call sites disappear from `libleanshared.so`. `lean_inc_heartbeat` stays exported and keeps updating the same counter, so objects compiled against an older header still work. The inline path is used only on GCC and Clang outside Windows and emscripten; elsewhere the out-of-line call is kept. Measured against the same tree, six interleaved runs each: `simp_local` -1.4% instructions and -1.35% cycles, `big_do` -1.6% instructions and -2.0% cycles, `simp_bubblesort_256` -1.4% instructions, `cbv_dedup` -1.2% instructions. Co-Authored-By: Claude <noreply@anthropic.com>
This is the repository for Lean 4.
See Install Lean.
Please read our Contribution Guidelines first.
See Building Lean.