News for hackers. Stuff that matters.
Re:Vale's First Prototype for Immutable Region Borrowing by rcxdude on Wednesday July 12, 2023 @05:52AM (#36692315)
It's pretty easy in a lot of embedded applications to basically only have objects that live forever or are allocated on the stack. I usually aim for zero heap at all, and just have statically allocated objects for the 'forever' set (which makes it easier to see what's using memory). If you're careful you can also statically work out worst-case stack usage as well and have a decent guarantee that you won't ever run out of memory. If there are short-lived objects, a memory pool or queue is usually the best option (though at that point you do invite use-after-free type errors and pool exhaustion). I would say with this style it's extremely rare to have memory safety issues, but it's also not really suitable to a lot of applications.
Re:Vale's First Prototype for Immutable Region Borrowing by Lk7Of3vfJS2n on Wednesday July 12, 2023 @10:25AM (#36695025)
Why is it not really suitable to a lot of applications?