mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 19:04:27 +03:00
wip
This commit is contained in:
parent
2bb99497e8
commit
35ab5ff089
13
mold.h
13
mold.h
@ -1256,17 +1256,10 @@ inline u64 align_to(u64 val, u64 align) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline u64 next_power_of_two(u64 val) {
|
inline u64 next_power_of_two(u64 val) {
|
||||||
if (val == 0)
|
assert(val >> 63 == 0);
|
||||||
|
if (val == 0 || val == 1)
|
||||||
return 1;
|
return 1;
|
||||||
|
return (u64)1 << (64 - __builtin_clzl(val - 1));
|
||||||
val--;
|
|
||||||
val |= val >> 1;
|
|
||||||
val |= val >> 2;
|
|
||||||
val |= val >> 4;
|
|
||||||
val |= val >> 8;
|
|
||||||
val |= val >> 16;
|
|
||||||
val |= val >> 32;
|
|
||||||
return val + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool Symbol::is_alive() const {
|
inline bool Symbol::is_alive() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user