Skip to content

Commit bf76a27

Browse files
authored
Update 2025-11-30-comptime-c-functions.md
1 parent 896fbd0 commit bf76a27

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Here is how it is achieved in C:
2727
- All operations become statically analyzable, reducing to constants.
2828
- `assert()` calls get eliminated when conditions are provably true.
2929

30+
It's fundamentally impossible for heap allocation to work with compile-time evaluation, and this applies to C, Zig, and Rust equally.
31+
3032
[Link-time optimization](https://en.wikipedia.org/wiki/Interprocedural_optimization) with `-flto` should allow GCC and Clang to perform these optimizations even when the code is split across several object files.
3133

3234
# Generic Stack

0 commit comments

Comments
 (0)