Skip to content

Commit 9cb692d

Browse files
authored
Update 2025-11-30-comptime-c-functions.md
1 parent 1d1784c commit 9cb692d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

_posts/2025-11-30-comptime-c-functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Here is how it is achieved in C:
2929

3030
This optimization requires stack-allocated buffers with constant addresses. Heap allocation breaks the optimization, because the compiler can't trace memory operations through dynamic allocations.
3131

32+
The only legitimate use-case I can think of for this technique is generating lookup tables at compile-time.
33+
3234
[Link-time optimization](https://en.wikipedia.org/wiki/Interprocedural_optimization) with `-flto` should allow Clang and GCC to perform these optimizations even when the code is split across several object files.
3335

3436
# Generic Stack

0 commit comments

Comments
 (0)