diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-08-05 16:03:11 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-08-05 16:03:11 -0700 |
| commit | e0e52953570caea66096cda08dc814f34735f7af (patch) | |
| tree | 75ee87cb8685fe72ef944970b5fc2dbfbfecaf6c /src/common.h | |
| parent | e939fa891b6403fcdaba7f545b2bf7932aa7f9ba (diff) | |
Fixed byte/element inconsistencies
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index abca66d..1154bdf 100644 --- a/src/common.h +++ b/src/common.h @@ -19,6 +19,8 @@ #define F64_EQ(x, y, eps) (fabs((x) - (y)) <= (eps)) #define MAX(n, m) ((n > m) ? (n) : (m)) #define MIN(n, m) ((n < m) ? (n) : (m)) +// n and m are expected to be byte counts (m a power of 2); keep call sites in bytes, +// not element counts, so alignment semantics stay consistent across the codebase. #define ALIGN_UP_POW2(n, m) (((u64)(n) + (u64)(m) - 1) & (~((u64)(m) - 1))) typedef int8_t i8; |