annotate src/ln.h @ 277:5854cbf18c67

fix_switchuvm_impl
author anatofuz
date Sat, 08 Feb 2020 15:49:00 +0900
parents f9169495d476
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
222
f9169495d476 order log calc
tobaru
parents:
diff changeset
1 static inline int ln(int sz) {
f9169495d476 order log calc
tobaru
parents:
diff changeset
2 int j = 1 << 6;
f9169495d476 order log calc
tobaru
parents:
diff changeset
3 for (int i = 6; i < 12; i++) {
f9169495d476 order log calc
tobaru
parents:
diff changeset
4 if (sz < j) return i;
f9169495d476 order log calc
tobaru
parents:
diff changeset
5 j <<= 1;
f9169495d476 order log calc
tobaru
parents:
diff changeset
6 }
f9169495d476 order log calc
tobaru
parents:
diff changeset
7 return 12;
f9169495d476 order log calc
tobaru
parents:
diff changeset
8 }
f9169495d476 order log calc
tobaru
parents:
diff changeset
9