Sunday, July 12, 2009

Can you help in the implementation of free() of C library with explaination of its working?

goto cprograming .com

Can you help in the implementation of free() of C library with explaination of its working?
You might want to refer to the source code and documentation of GNU's C Library for that.
Reply:free() frees memory allocated by malloc().


Under Borland C++


malloc() and free() use a heap.


malloc() allocates memory from the heap and returns a pointer to the allocated memory if possible.


free() frees up the memory allocated by malloc() back to heap


No comments:

Post a Comment