Practice · 4 of 4
Alignment Helper
CHALLENGE
Difficulty: advanced+25 XP
Implement unsigned char *align_up(unsigned char *p, size_t align) returning the smallest address >= p that is a multiple of align (align is a power of two). This is the helper every arena needs before handing out typed slices.
Press Submit to check your solution.
Back to lesson: Practice: Allocator Engineering Drills