4 ms·
A variant of that I've seen in many small 1990s C apps is create a huge struct with all the program data in it, with fixed size arrays of things big enough so t
by zlynx 9y ago
A variant of that I've seen in many small 1990s C apps is create a huge struct with all the program data in it, with fixed size arrays of things big enough so that's all you ever need, and just declare one global struct.
It was one struct instead of separate globals because of some coding style guide at the time.
"But what if we want to use this in a library?"
"Here's all the data in one container, malloc it and use that."
I don't think many of those programs ever did end up in libraries.
- MBCook 9y agoSo basically the way people ‘allocated’ memory in small assembly programs.
- tempodox 9y agoThe original yacc(1) was written with fixed-size arrays for the parser tables, statically allocated. If the parser was too complex, the arrays would blow. To fix that, change the DEFINEs and recompile yacc.