h Home

Dynamic memory allocation:


dynamic memory allocation



How does free () know how many bytes to free?



The malloc/free Implementation remembers the size of each block as it is allocated, so it is not necessary to remind it of the size when freeing.


Typically,the size is stored adjacent to the allocated block,which is why things usually break badly if the bounds of the allocated block are even slightly overstepped.




      We provide material for the educational purposes only. We do not responsiable for the correctness of its contents. the risk of using it lies entirelywith the user.