How Do malloc & free Work in C!

As we know, the process can allocate & deallocate memory using malloc & free in C language. But do you ever consider what happens behind the scene ? or How do malloc & free work? Let see Allocating Memory on the Heap A process can allocate memory by increasing the size of the heap. Heap is a variable-size segment of contiguous virtual memory that begins just after the uninitialized data segment of a process and grows & shrinks as memory allocated and freed....

October 8, 2016 · 5 min · 876 words · Vishal Chovatiya