Question

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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.

Add a comment
Know the answer?
Add Answer to:
Question 1 1 pts Given the following heap diagram with block headers, requiring double-word alignment, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • These are my answere to the following questions: are they right? 1. B 2. T 3....

    These are my answere to the following questions: are they right? 1. B 2. T 3. T 4. T 5. F 6. T 7. A 8. D 9. E 10. B 11. B 12. A 13. A 14. D 15. C 16. D 17. T 18. C 19. T 20. T 21. T 22. A 23. T 24. D 25. B 26. A 27. A 28. A 29. T 30. C 31. D 32. A 33. T 34. F 35....

  • This assignment is comprised of 3 parts: ​All files needed are located at the end of...

    This assignment is comprised of 3 parts: ​All files needed are located at the end of the directions. Part 1: Implementation of Dynamic Array, Stack, and Bag First, complete the Worksheets 14 (Dynamic Array), 15 (Dynamic Array Amortized Execution Time Analysis), 16 (Dynamic Array Stack), and 21 (Dynamic Array Bag). These worksheets will get you started on the implementations, but you will NOT turn them in. ​Do Not Worry about these, they are completed. Next, complete the dynamic array and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT