diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/stdlib/malloc.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index c6261d87c5..f067dd1f37 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: malloc.c,v 1.299 2025/06/12 16:07:09 deraadt Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.300 2025/10/23 18:49:46 miod Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008, 2010, 2011, 2016, 2023 Otto Moerbeek <otto@drijf.net> |
| 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> | 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> |
| @@ -1091,24 +1091,6 @@ err: | |||
| 1091 | return NULL; | 1091 | return NULL; |
| 1092 | } | 1092 | } |
| 1093 | 1093 | ||
| 1094 | #if defined(__GNUC__) && __GNUC__ < 4 | ||
| 1095 | static inline unsigned int | ||
| 1096 | lb(u_int x) | ||
| 1097 | { | ||
| 1098 | #if defined(__m88k__) | ||
| 1099 | __asm__ __volatile__ ("ff1 %0, %0" : "=r" (x) : "0" (x)); | ||
| 1100 | return x; | ||
| 1101 | #else | ||
| 1102 | /* portable version */ | ||
| 1103 | unsigned int count = 0; | ||
| 1104 | while ((x & (1U << (sizeof(int) * CHAR_BIT - 1))) == 0) { | ||
| 1105 | count++; | ||
| 1106 | x <<= 1; | ||
| 1107 | } | ||
| 1108 | return (sizeof(int) * CHAR_BIT - 1) - count; | ||
| 1109 | #endif | ||
| 1110 | } | ||
| 1111 | #else | ||
| 1112 | /* using built-in function version */ | 1094 | /* using built-in function version */ |
| 1113 | static inline unsigned int | 1095 | static inline unsigned int |
| 1114 | lb(u_int x) | 1096 | lb(u_int x) |
| @@ -1116,7 +1098,6 @@ lb(u_int x) | |||
| 1116 | /* I need an extension just for integer-length (: */ | 1098 | /* I need an extension just for integer-length (: */ |
| 1117 | return (sizeof(int) * CHAR_BIT - 1) - __builtin_clz(x); | 1099 | return (sizeof(int) * CHAR_BIT - 1) - __builtin_clz(x); |
| 1118 | } | 1100 | } |
| 1119 | #endif | ||
| 1120 | 1101 | ||
| 1121 | /* https://pvk.ca/Blog/2015/06/27/linear-log-bucketing-fast-versatile-simple/ | 1102 | /* https://pvk.ca/Blog/2015/06/27/linear-log-bucketing-fast-versatile-simple/ |
| 1122 | via Tony Finch */ | 1103 | via Tony Finch */ |
