Arthur Chima’s Post

View profile for Arthur Chima, graphic

Lead Developer @ OmeeNee || Building with Rust , Typescript , Nextjs , Node

So , not to bug you , but my 2 cents again. So in trying to understand how memory allocation and deallocation works in certain technologies, I got my hands soiled in rust. So rust does something interesting with Strings - and other data types that are stored on the heap. So in most languages I know , strings are references - they point to somewhere in memory. What happens when you've got two variables pointing to the same location and they are ready to clear their memory after they go out of scope¿ Do they clear the same memory¿ This will cause memory issues.. What rust does is , rust is like " look s1, I know you were first to point to this location, but s2 wants to help you do that so you know what s1, you can go home. Let s2 handle it ". So at any point in time , only one item is pointing to somewhere in memory( usually the heap ). This helps memory management a great deal. Please note: this is spoken in reference to values stored on the heap . Memory management in stacks are fairly straightforward.. my 2 cents; might not be the most accurate 2 cents..

  • text

To view or add a comment, sign in

Explore topics