Re:Writing a Simple Garbage Collector in C (2020)
by mcguire on Saturday April 08, 2023 @05:10PM
(#35497669)
"The usual memory management practice" in C depends a lot an what you are doing. Malloc/free scattered through your code is...not uncommon. That does require discipline or ugliness ensues. Other common options are not allocating, which is kind of limiting but the only option under very tight memory constraints, and doing specific domain management options.
One of the best of the latter is arena management. (https://en.wikipedia.org/wiki/Region-based_memory_management)