aboutsummaryrefslogtreecommitdiff
path: root/include/apos/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/apos/utils.h')
-rw-r--r--include/apos/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/apos/utils.h b/include/apos/utils.h
index 318ba0a..b973d49 100644
--- a/include/apos/utils.h
+++ b/include/apos/utils.h
@@ -54,6 +54,14 @@ static inline size_t align_down(size_t val, size_t a)
return val - (val % a);
}
+static inline bool aligned(size_t val, size_t a)
+{
+ if (!a)
+ return true;
+
+ return val % a == 0;
+}
+
static inline size_t asciinum(char c)
{
if(c >= '0' && c <= '9')