Can you explain why this is necessary? Is there a non-page-aligned size that gets added in a previous alloc to cause next_address to not be page aligned?

If I'm understanding this right, if this is the first alloc, then next_address is initially 0x10000000 which I would assume is page aligned.

Can this logic be done when next_address is updated on line 270 instead?