Question: Implement free (without using the preexisting free function) in C. Given a pointer to a block of memory that you have allocated, implement your own

Implement free (without using the preexisting free function) in C. Given a pointer to a block of memory that you have allocated, implement your own version of free to deallocate this block of memory. At the end, the pointer should still point to the same address but the address should now be invalid (cleared.) If the pointer is a NULL pointer initially, then do nothing.

void free(void *pointer) { // implement free! }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!