diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-05-23 19:54:55 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-05-23 19:59:39 +0300 |
| commit | 6a7073e5f262db9a4578ff00b5b28e34335564ce (patch) | |
| tree | 38294048ff12b2abc6fc9c2fe967eae9d7b8c3b7 /include | |
| parent | c18ec832ed592e4c6171139a8aaadde827cb13da (diff) | |
| download | kmi-6a7073e5f262db9a4578ff00b5b28e34335564ce.tar.gz kmi-6a7073e5f262db9a4578ff00b5b28e34335564ce.zip | |
improve id handling
+ The number of allowed threads running at the same time is limited to
num_tids, but each thread's ID can be any larger than that. This
should make ID reuse a lot more rare, and probably makes certain kinds
of time-of-check-to-time-of-use attacks more difficult
Diffstat (limited to 'include')
| -rw-r--r-- | include/kmi/bits.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/kmi/bits.h b/include/kmi/bits.h index 738f1d5..5fe438c 100644 --- a/include/kmi/bits.h +++ b/include/kmi/bits.h @@ -379,4 +379,6 @@ uint64_t __bswap64(uint64_t u); #endif +#define is_powerof2(x) (((x) & ((x) - 1)) == 0) + #endif /* KMI_BITS_H */ |
