|
|
|
|
|
by hinkley
2311 days ago
|
|
I can’t remember the last time I read C code, but I do recall a particular time when I was reading a library that had been written with a great deal of attention to reliability.
The first thing it did was allocate enough memory for the shutdown operations. That way on a malloc() failure, it could still do a a completely orderly shutdown. Or never start in the first place. From that standpoint, you could also categorize arenas on a priority basis. This one is for recovery operations, this one for normal operation, and whatever is left for low priority tasks. |
|
That is clever and beautiful. Have to look for chances to do similar to see if I can establish a new habit myself.