newhmr->sz & (TARGET_PAGE_SIZE-1)
As TARGET_PAGE_SIZE is a power of 2, (TARGET_PAGE_SIZE-1) will be all 1's.
If sz is not a power of 2 (and it may be - it's a user's input) - bitwise AND won't give 0.