bit_util: Change ffs functions indexing.
Making these 0-based instead of 1-based makes calling code simpler and will be more consistent with functions introduced in subsequent diffs.
This commit is contained in:
committed by
David Goldblatt
parent
786a27b9e5
commit
1ed0288d9c
@@ -211,8 +211,8 @@ pages_map(void *addr, size_t size, size_t alignment, bool *commit) {
|
||||
flags |= MAP_FIXED | MAP_EXCL;
|
||||
} else {
|
||||
unsigned alignment_bits = ffs_zu(alignment);
|
||||
assert(alignment_bits > 1);
|
||||
flags |= MAP_ALIGNED(alignment_bits - 1);
|
||||
assert(alignment_bits > 0);
|
||||
flags |= MAP_ALIGNED(alignment_bits);
|
||||
}
|
||||
|
||||
void *ret = mmap(addr, size, prot, flags, -1, 0);
|
||||
@@ -600,7 +600,7 @@ init_thp_state(void) {
|
||||
#endif
|
||||
|
||||
if (nread < 0) {
|
||||
goto label_error;
|
||||
goto label_error;
|
||||
}
|
||||
|
||||
if (strncmp(buf, sys_state_madvise, (size_t)nread) == 0) {
|
||||
|
Reference in New Issue
Block a user