AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
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