Skip to main content

Practice · 1 of 1

Arena Carve and Reset

CHALLENGE
Difficulty: advanced+25 XP

Implement a tiny linear arena: Arena(bytes) owns a buffer; carve(n) returns a pointer into it (16-byte aligned) or nullptr if n does not fit; reset() makes the whole buffer reusable; used() reports allocated bytes.

Back to lesson: Practice: Practice: Arena and pmr