3 ms·
This is the kind of advice that I put in a category of "easier said than done". The trouble is that you may not know beforehand what exactly is going to be nee
by lmilcin 5y ago
This is the kind of advice that I put in a category of "easier said than done".
The trouble is that you may not know beforehand what exactly is going to be needed. And you might need maybe a library call and the library does dynamic allocation in it and you either have no idea about it (until you find out the hard way) or no way to help it.
So in the end maybe you can take some extremely simple action like writing something to log or show a widget, but that's about it.
- dnautics 5y agoJust code as normal and when you run into a problem, reassign the default allocator for the struct/object? Not possible for many PLs, hard for some but basically trivial (1 LOC per struct/object) for others. Some PLs come with test suites that give you a failing allocator, so you can even easily test to make sure this looping condition resolves sanely.