ref: renamed types.h to Types.h for match naming convention; also added Align.h and Bytes.h with helpers

This commit is contained in:
karina
2026-04-25 09:56:17 +04:00
parent b606fa23d0
commit e49af76aef
11 changed files with 78 additions and 7 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <Types.h>
static inline UInt64 AlignUp64(UInt64 value, UInt64 alignment) {
return (value + alignment - 1) & ~(alignment - 1);
}
static inline UInt64 AlignDown64(UInt64 value, UInt64 alignment) {
return value & ~(alignment - 1);
}
static inline UInt32 AlignUp32(UInt32 value, UInt32 alignment) {
return (value + alignment - 1) & ~(alignment - 1);
}
static inline UInt32 AlignDown32(UInt32 value, UInt32 alignment) {
return value & ~(alignment - 1);
}