mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-31 15:38:08 +03:00
parent
c4c2592c83
commit
f408643a4c
104 changed files with 1161 additions and 1168 deletions
|
|
@ -10,13 +10,13 @@ static __forceinline int ffsl(long x) {
|
|||
unsigned long i;
|
||||
|
||||
if (_BitScanForward(&i, x)) {
|
||||
return (i + 1);
|
||||
return i + 1;
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __forceinline int ffs(int x) {
|
||||
return (ffsl(x));
|
||||
return ffsl(x);
|
||||
}
|
||||
|
||||
# ifdef _M_X64
|
||||
|
|
@ -27,9 +27,9 @@ static __forceinline int ffsll(unsigned __int64 x) {
|
|||
unsigned long i;
|
||||
#ifdef _M_X64
|
||||
if (_BitScanForward64(&i, x)) {
|
||||
return (i + 1);
|
||||
return i + 1;
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
#else
|
||||
// Fallback for 32-bit build where 64-bit version not available
|
||||
// assuming little endian
|
||||
|
|
@ -41,11 +41,11 @@ static __forceinline int ffsll(unsigned __int64 x) {
|
|||
s.ll = x;
|
||||
|
||||
if (_BitScanForward(&i, s.l[0])) {
|
||||
return (i + 1);
|
||||
return i + 1;
|
||||
} else if(_BitScanForward(&i, s.l[1])) {
|
||||
return (i + 33);
|
||||
return i + 33;
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue