2 ms·
I just addressed this the other day, when a pull request wanted to use exponential growth in the buffer. I told them not to. The difference is that this softwar
by Sir_Cmpwn 12y ago
I just addressed this the other day, when a pull request wanted to use exponential growth in the buffer. I told them not to. The difference is that this software is going to run on an embedded sytsem for which I wrote the kernel, and I wrote the realloc function for. My realloc expands the block instead of moving data when possible, and I know that that's a likely scenario during normal operation. On top of that, there's only 32K of memory to go around, so wasting space on exponential growth is a bad idea.
Always be willing to question the standard doctrine.
- beagle3 12y agoThere's only 32K of memory to go around, and you're doing dynamic memory allocation? It's been 20 years or so since I last touched such a limited memory system - and everyone I know who did switched to static allocations after being bitten by the unpredictability of dynamic allocations.
- Sir_Cmpwn 12y agoGoing on 4 years and it's working out well so far.