Free Implementation Quiz

Trace the representation, diagnose a boundary failure, and reconstruct a changed case.


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

1. A pointer p was allocated by the teaching allocator, then freed. Another allocation reuses its block. What does writing through the old p risk? Select one.

Select one answer.

2. Why is my_free(NULL) handled before computing the preceding header? Select one.

Select one answer.

3. A diagnostic reads a magic value just before any supplied pointer. Does a matching value establish general pointer validity? Select one.

Select one answer.

4. After freeing an interior block, does this simple flag-based allocator lower the program break? Answer yes or no.
5. Illustrative header size H=24, alignment A=8, current break=4125. A 9-byte allocation is requested. At what address does its payload begin? Answer in decimal.
6. In free-basic, allocate A, free A, then allocate a smaller B. Which behavior belongs to this stage? Select one.

Select one answer.

7. Heap growth fails while requesting a new block. When may the list gain a new successor? Select one.

Select one answer.

8. Why reject size > INTPTR_MAX-H-(A-1) before growth? Select one.

Select one answer.

Join Discord