General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Liam
Brodie Robertson
comments
Comments by "Liam" (@1495978707) on "Memory Safe Languages DO NOT PREVENT MEMORY LEAKS" video.
Memory safety has nothing to do with leaks (forgetting to free memory), it has to do with accessing memory that you shouldn't be able to. Rust is memory safe because you have to be very explicit about how you interact with data, and it puts heavy restriction on how this can be done. To stop leaks, every part of the stack needs to remember to free memory, and people can fuck up at any level. This is why so many people just say screw it and take responsibility for their memory handling in C, even though it's harder. Its different when bugs happen because of you vs a giant team of people that you trusted
2
@gratuxAutomatic leak prevention basically requires deleting everything created within a scope when the scope ends. But what if you need to create things in a nested smaller scope and use them in the parent scope? Or another smaller scope? This kind of thing is why whole cloth OOP and factory type programming is so difficult to do right, it's full of cases where you allocate in one scope in order to construct an object, and then pass to another scope where more might be added, and so on. It may be very general and abstract, but it makes it mindnumbingly difficult to understand the code and find memory leaks, and it requires bypassing automatic protections that delete everything when a scope ends.
1