Skip to content

Commit 9b8308e

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

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ main:
2323
Here is how it is achieved in C:
2424
- `static inline` allows inlining across compilation boundaries.
2525
- `__attribute__((always_inline))` *strongly* urges compilers to inline functions.
26+
- `__builtin_unreachable()` is used to teach the optimizer which assumptions it can make about input arguments.
2627
- Constant buffer addresses + sizes let the optimizer trace through `memcpy()` calls.
2728
- All operations become statically analyzable, reducing to constants.
2829
- `assert()` calls get eliminated when conditions are provably true.

0 commit comments

Comments
 (0)