summaryrefslogtreecommitdiff
path: root/source/base/base_memory.cpp
blob: e99c1743d50fdc5e8e1ec949ece0db8f831a51d2 (plain)
1
2
3
4
5
6
7
8
9
10
internal b32 is_pow(umm x) { return (x & (x - 1)) == 0; }

internal u64 align(u64 pointer, umm alignment)
{
    if ((alignment & (alignment - 1)) != 0) {
        return pointer;
    }

    return (pointer + alignment - 1) & ~(alignment - 1);
}