Skip to content

Commit 0b5b327

Browse files
authored
Update 2025-11-30-comptime-c-functions.md
1 parent 7c0eb59 commit 0b5b327

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ date: 2025-11-30 12:00:00 +0100
77
Compile-time function execution is great, as it means your program has to run less code at runtime, but what if:
88
1. You're stuck with C.
99
2. You don't want to use evil C macros, as they are debugging nightmares.
10-
3. You want type-generic data structures that work for all types, and that can use `malloc()` and `free()` internally.
10+
3. You want data structures that work for all types, and that can use `malloc()` and `free()` internally.
1111

1212
This blog post shows programs where data structures get completely optimized away at compile time by Clang and GCC, using [constant folding](https://en.wikipedia.org/wiki/Constant_folding), [inlining](https://en.wikipedia.org/wiki/Inline_expansion), and [dead code elimination](https://en.wikipedia.org/wiki/Dead-code_elimination). Here is the x86-64 Assembly that their functions get optimized down to:
1313
```nasm

0 commit comments

Comments
 (0)