3 ms·
> c has no memory management You might argue that C's memory management is simplistic, lacking, or error prone, that it is not automatic, that there is no garb
by mynegation 7y ago
> c has no memory management
You might argue that C's memory management is simplistic, lacking, or error prone, that it is not automatic, that there is no garbage collection, but to say that C has no memory management is objectively wrong and detrimental to the understanding of how C works.
Stack memory is tracked by both compiler and - in some cases - runtime (see "alloca") by creating a code that manipulates a set of registers. The memory in the heap is managed by a minimal set of calls: you can allocate a chunk of memory of a certain size, you can release it, or you can attempt to re-allocate it. Each of those calls maintains a data structure for tracking available chunks of memory in the raw address space, which programmer does not have to write. This is memory management.