We can go further, I think it's impossible to prevent memory leaks in a general purpose language
hairyballs
joined 2 years ago
The only thing doing tech tests has taught me is that I'm too stupid to do the job I've been doing professionally for the better part of 2 decades.
The only thing doing tech tests has taught me is that I'm too stupid to do the job I've been doing professionally for the better part of 2 decades.
The only thing doing tech tests has taught me is that I'm too stupid to do the job I've been doing professionally for the better part of 2 decades.
- I put the types first in the file, sorted by importance
- then the public free functions
- then the impl blocks, sorted by importance, also. Usually, display impls and similar end up being at the end
- then the private free functions (helpers)
The idea is that I can see all the types in one glance, then I look at the rest.
view more: next ›
And here you're only talking about a subset of memory leaks, by inaccessible memory. You can also leak memory by pushing new elements in a channel while never reading them for example.