Avoiding Malloc for Small Strings in C with Variable Length Arrays (VLAs)(medium.com)
medium.com
Avoiding Malloc for Small Strings in C with Variable Length Arrays (VLAs)
https://medium.com/@yair.lenga/avoiding-malloc-for-small-strings-in-c-with-variable-length-arrays-vlas-7b1fbcae7193
1 コメント
This looks at replacing malloc/free for small temporary strings with VLAs, using a stack-first approach with heap fallback.
Benchmarks were a bit surprising—allocator behavior (especially on musl) changes the trade-offs more than I expected.
Interested in how others approach temporary allocation patterns.