Rustacean Station  cover image

Rust for Rustaceans by Jon Gjengset

Rustacean Station

CHAPTER

Is It OK to Deallocate Memory in Rust?

In general all of the memory backed operations in Rust are infallible like they if you do something like Vekt.push it doesn't return a result but there's no way for you to know that you ran off memory because what happens under the hood is that push if it needs to try to allocation more memory and if it fails to allocate more memory at panics which as you say unwinds. The ask was we need fallible versions of all potentially allocating operations this islike Vekt Reserve Vekt Push string append in hash map insert and so any operation that could potentially allocate needs to have a sort of tri version of the method that returns an error if memory

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner