diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-06-19 16:26:19 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-06-19 16:26:19 +0300 |
commit | b1b9f621a44725509aa7b6eab7305542945893a3 (patch) | |
tree | c9925a19d7304f52d9d5e2cc87a5ba5cc72acd4a /src/nxt_clang.h | |
parent | 7574c64992b98d3dfbc3dd101bd0f7d78bad0823 (diff) | |
download | unit-b1b9f621a44725509aa7b6eab7305542945893a3.tar.gz unit-b1b9f621a44725509aa7b6eab7305542945893a3.tar.bz2 |
Memory pools refactoring.
Diffstat (limited to 'src/nxt_clang.h')
-rw-r--r-- | src/nxt_clang.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nxt_clang.h b/src/nxt_clang.h index 31bc6fda..82979c6a 100644 --- a/src/nxt_clang.h +++ b/src/nxt_clang.h @@ -207,6 +207,12 @@ nxt_bswap32(val) \ | ((val) << 24)) +#define nxt_is_power_of_two(value) \ + ((((value) - 1) & (value)) == 0) + +#define nxt_lg2(value) \ + (31 - __builtin_clz(value)) + #define \ nxt_align_size(d, a) \ |