Memory allocation/deallocation routines malloc() and free()
According to my declaration, allocate the 50000 block of array. If memory block is available on the array, the program allocates a block from the array according to specify size. Here I used the array data structure to implement the heap. In this code taken large contiguous buffer which used to allocate all the spaces associate with the NewMalloc() function. There doesn't allocate the same region of memory to two different NewMalloc() . Initially all 50000 bytes are free in this array. NewMalloc() It takes one integer argument which represents the size and return a pointer to a contiguous region of that many bytes. Now call to NewMalloc(60) . There we expect to allocate the first 60 bytes and return a pointer to the caller. Actually in the array allocates 68-bytes for that region. Because I maintain a meta data that k...