Apple interview question

Aligned malloc to address and alignment

Interview Answer

Anonymous

Aug 8, 2025

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