Question: The library routine ma/lc allocates more data space to a process by invoking the brk system call, and the library routine free releases memory previously

The library routine ma/lc allocates more data space to a process by invoking the brk system call, and the library routine free releases memory previously allocated by malloc. The syntax for the calls is ptr malloc (size);

where size is an unsigned integer representing the number of bytes to allocate, and ptr is a character pointer that points to the newly acquired space. When used as a parameter for free, ptr must have been previously returned by malloc. Implement the library routines.

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 Programming Questions!