Question 1 1 pts Given the following heap diagram with block

Question 1 1 pts Given the following heap diagram with block headers, requiring double-word alignment, and using a next-fit placement policy: 0x 0 0 0x 08 0x 10 0x 18 0x 20 0x 28 0x 30 0x 38 0x 40 16/1 16/0 8/0 8/0 If the block at address Ox 24 was the last (most recent) allocated, what address is assigned to ptr for the heap request below: ptr malloc (2 sizeof (char) Use the same format for your answer as shown in the diagram above \"Ox NN\" without any spaces, no quotes and where N is a digit.

Solution

1) 0x_25, 2 bytes of space will be allocated because char requires 1 byte. Next fit started to search for allocation from last allocation point.

2) 0_00, 4 bytes of storage will be allocated becuase int contains 2 Byte of memory, First fit starts to search for allocation from start of the memory space, irrespestive of where the last allocation was.

 Question 1 1 pts Given the following heap diagram with block headers, requiring double-word alignment, and using a next-fit placement policy: 0x 0 0 0x 08 0x 1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site