projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
malloc: cast size down to int in bin_index functions
[musl]
/
src
/
malloc
/
malloc.c
diff --git
a/src/malloc/malloc.c
b/src/malloc/malloc.c
index
1a1a51f
..
207b6ef
100644
(file)
--- a/
src/malloc/malloc.c
+++ b/
src/malloc/malloc.c
@@
-120,14
+120,14
@@
static int bin_index(size_t x)
x = x / SIZE_ALIGN - 1;
if (x <= 32) return x;
if (x > 0x1c00) return 63;
x = x / SIZE_ALIGN - 1;
if (x <= 32) return x;
if (x > 0x1c00) return 63;
- return ((union { float v; uint32_t r; }){
x
}.r>>21) - 496;
+ return ((union { float v; uint32_t r; }){
(int)x
}.r>>21) - 496;
}
static int bin_index_up(size_t x)
{
x = x / SIZE_ALIGN - 1;
if (x <= 32) return x;
}
static int bin_index_up(size_t x)
{
x = x / SIZE_ALIGN - 1;
if (x <= 32) return x;
- return ((union { float v; uint32_t r; }){
x
}.r+0x1fffff>>21) - 496;
+ return ((union { float v; uint32_t r; }){
(int)x
}.r+0x1fffff>>21) - 496;
}
#if 0
}
#if 0