Skip to content
Atlas
what-a-request-costsround-it-upthe-second-freecoalesce-to-fit

1 of 4

Work out what a request really costs, spot the frees that go wrong, and coalesce a fragmented heap until a request fits.

A program calls malloc(20). How many bytes does the allocator take out of the pool to serve it?

header size
8 bytes in front of every block
alignment
8 bytes for the start of the next block
requested payload
20 bytes
bytes