Y
Hacker News
new
|
ask
|
show
|
jobs
by
bertylicious
114 days ago
Nice! That's (seems) so simple yet also so very effective. Shouldn't other memory-managed languages be able to profit from this as well?
2 comments
KolmogorovComp
114 days ago
It’s a very well known pattern, as someone else mentioned it’s used in CPP in smallstring, Rust smallvec, C usually hand rolled etc.
link
lionkor
114 days ago
C# has `stackalloc`
link
bertylicious
114 days ago
But that requires an explicit declaration and isn't done automatically under the hood, or am I missing something?
link
Smaug123
114 days ago
The JIT does this automatically in some cases as of .NET 10 (
https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotn...
).
link