Modify MPMCQueue behaviour to use i32 over isize; Correct cache line padding within MPMCQueue

This commit is contained in:
gingerBill
2021-07-28 00:59:30 +01:00
parent 541c79c01a
commit af32aba7fc
2 changed files with 46 additions and 35 deletions

View File

@@ -763,7 +763,19 @@ isize next_pow2_isize(isize n) {
n++;
return n;
}
u32 next_pow2_u32(u32 n) {
if (n == 0) {
return 0;
}
n--;
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
n++;
return n;
}
i32 bit_set_count(u32 x) {