2dbi
Home/Broadcom/Implement a Simple malloc / Free List
BBroadcom·DSASDE-2Onsite – Coding 2

Implement a Simple malloc / Free List

Problem

Sketch a custom malloc/free over a fixed memory arena: maintain a free list, split and coalesce blocks.

Example

alloc(16), alloc(32), free(first), alloc(16) reuses the freed block

Constraints

  • Avoid fragmentation where possible

What Broadcom looks for

Understanding of heap mechanics, headers, alignment, and coalescing.

added 6 days ago
LeadersAccount