Write a program to simulate a dynamic memory subsystem.

computer science

Description

Write a program to simulate a dynamic memory subsystem. The program should have function(s) which accept(s) input in the form of 1) pid, allocate, size in bytes, 2) pid, free, address, and 3) pid, resize, address, new size. *** If the requests are valid and adequate space is available, 1) and 3) should return the address of the space granted; otherwise, they should return 0. *** request of the form 2) should return 0 for valid requests and -1 for invalid ones. Create a test trace for at least 5 processes (5 unique pids). Clearly comment your code


Related Questions in computer science category