liveBook · Manning

Inlining

Inlining is a compiler or runtime transformation that replaces a function or method call with its implementation at the call site.

How 4 Manning books explain it

Clojure: The Essential Reference

Inlining is a compilation technique that substitutes an alternative implementation for a var invocation instead of using its root or thread binding.

How it is used
Uses inline implementations chiefly to improve Java interop overload selection at direct calls.
How deep it goes
Explains var precedence, definline expansion, call behavior, and a compiled interop example; does not develop a general compiler implementation.
Examples
Compares direct calls with map, then contrasts Object and primitive Java overloads through an inlined wrapper.
What you can do after
Apply it via definline to expose a direct-call Java interop implementation while retaining ordinary function use.

Read how Clojure: The Essential Reference explains inlining →

Modern C

Inlining is a compiler transformation that replaces a function call with the called function's implementation in the caller's context.

How it is used
Reduces function-call overhead and exposes callee instructions to further optimization.
How deep it goes
Explains call overhead, definition visibility, and optimization opportunities without detailing compiler heuristics or generated machine code.
Examples
Uses an inline toto_init definition in a header and a separate declaration for one translation unit.
What you can do after
Apply it via visible C function definitions while managing header inclusion and one-translation-unit instantiation.

Read how Modern C explains inlining →

Modern C, Third Edition

Inlining is a compiler transformation that replaces a function call with the called function's implementation.

How it is used
Uses function-definition visibility to reduce call overhead and expose additional compiler optimizations.
How deep it goes
Explains replacement semantics, call overhead, optimization opportunities, and definition-visibility strategies across translation units.
Examples
Uses a small inline initializer, a header definition, and a separate translation-unit declaration.
What you can do after
Evaluate when visible C definitions can eliminate call overhead and enable context-sensitive optimization.

Read how Modern C, Third Edition explains inlining →

100 Go Mistakes and How to Avoid Them

Inlining is a compiler transformation that replaces a function call with the body of the called function.

How it is used
Uses compiler inlining to explain optimization-aware Go benchmarking and fast-path implementation choices.
How deep it goes
Explains substitution, budgets, diagnostics, benefits, mid-stack behavior, and benchmark consequences without detailing compiler internals.
Examples
Demonstrates popcnt benchmarks, sum substitution, compiler budget diagnostics, and sync.Mutex fast- and slow-path structure.
What you can do after
Diagnose misleading Go benchmarks and inspect compiler inlining decisions with -gcflags "-m=2".

Read how 100 Go Mistakes and How to Avoid Them explains inlining →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.