1.

How Does Free() Method Know About How Much Memory To Release?

Answer»

There's no concrete way. Most systems, keeps a TRACK of each MEMORY block as linked lists. When memory is allocated, all the blocks that are given to that PARTICULAR call are put into a linked list and the SIZE, block number and serial number are WRITTEN in the head node. There is no assurance, though. But in some way or other, the system keeps track of each block to know the size of each allocated portion of the heap.

There's no concrete way. Most systems, keeps a track of each memory block as linked lists. When memory is allocated, all the blocks that are given to that particular call are put into a linked list and the size, block number and serial number are written in the head node. There is no assurance, though. But in some way or other, the system keeps track of each block to know the size of each allocated portion of the heap.



Discussion

No Comment Found