Memory Fundamentals Quiz

Test understanding of heap memory and sbrk


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. The break is 1000. A successful request for 64 returns which address and leaves which break? Select one.

Select one answer.

2. After reset, requests for 10 and 6 succeed, zero is rejected, and a request for 20 fails at sbrk. What is heap_total_requested()? Answer in decimal bytes.
3. For that same sequence (successful 10, successful 6, rejected zero, failed positive 20), how many growth attempts are counted?
4. A size_t request exceeds INTPTR_MAX. What should happen before calling sbrk? Select one.

Select one answer.

5. The successful-byte counter is T. Which check avoids size_t addition overflow before adding n? Select one.

Select one answer.

6. After several requests, heap_init is called again. What changes? Select one.

Select one answer.

7. A, B, C occupy consecutive blocks and C is live. Why not release interior B by lowering the break through it? Select one.

Select one answer.

8. Two raw one-byte growth requests both succeed. What does that establish? Select one.

Select one answer.

Join Discord