In this article https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/c-custom-memory-allocation-r3010/ it says “To n-byte align a memory address x we need to mask off the log2(n) least significant bits from x. Simply masking off bits will return the first n-byte aligned address before x, so in order to find the first after x we just need to add alignment-1 to x and mask that address.” in the Aligned Allocations implementation section, and codes that use alignment - 1.
I generally understand of what this article offers, but what's been bugging me is I can't quite understand just this particular part about “alignment - 1”. What is the reason of subtracting alignment by 1 here?
edit: sorry maybe this should've been in Beginner's channel