this post was submitted on 21 Aug 2025
30 points (96.9% liked)

Rust

7269 readers
20 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
 

This releases includes some pretty nice improvements to the usage of the crate.

If you want to know how the View types I talk about in the release post are built, take a look at my post from back when I contributed them:

https://sgued.fr/blog/heapless-howto/

you are viewing a single comment's thread
view the rest of the comments
[–] Vorpal@programming.dev 2 points 8 months ago (1 children)

Not really. Heapless uses compile time sized backing buffers to implement Vec, string etc with a max upper size. You would typically use heapless with a statically allocated variable, but it is possible to use it on the stack too.

Alloca is different and allocates a dynamically sized block on the stack. Rust doesn't really support alloca, but there is a crate for it that works by calling through a helper function in C: https://lib.rs/crates/alloca

[–] Sivecano@lemmy.dbzer0.com 1 points 8 months ago

Awww. why doesn't rust do alloca actually?