Apple interview question

Aligned malloc to address and alignment

Interview Answer

Anonymous

8 Aug 2025

Align with larger malloc (required + alignment) and then move the returned ptr closer to the alignment if it is not NULL.