summaryrefslogtreecommitdiff
path: root/source/base/base_memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/base/base_memory.cpp')
-rw-r--r--source/base/base_memory.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/base/base_memory.cpp b/source/base/base_memory.cpp
new file mode 100644
index 0000000..e99c174
--- /dev/null
+++ b/source/base/base_memory.cpp
@@ -0,0 +1,10 @@
1internal b32 is_pow(umm x) { return (x & (x - 1)) == 0; }
2
3internal u64 align(u64 pointer, umm alignment)
4{
5 if ((alignment & (alignment - 1)) != 0) {
6 return pointer;
7 }
8
9 return (pointer + alignment - 1) & ~(alignment - 1);
10}