mirror of git://sourceware.org/git/glibc.git
malloc: Improve csize2tidx
Remove the alignment rounding up from csize2tidx - this makes no sense since the input should be a chunk size. Removing it enables further optimizations, for example chunksize_nomask can be safely used and invalid sizes < MINSIZE are not mapped to a valid tidx. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
5291d9f1e2
commit
575de3d666
|
@ -298,7 +298,7 @@
|
|||
# define tidx2usize(idx) (((size_t) idx) * MALLOC_ALIGNMENT + MINSIZE - SIZE_SZ)
|
||||
|
||||
/* When "x" is from chunksize(). */
|
||||
# define csize2tidx(x) (((x) - MINSIZE + MALLOC_ALIGNMENT - 1) / MALLOC_ALIGNMENT)
|
||||
# define csize2tidx(x) (((x) - MINSIZE) / MALLOC_ALIGNMENT)
|
||||
/* When "x" is a user-provided size. */
|
||||
# define usize2tidx(x) csize2tidx (request2size (x))
|
||||
|
||||
|
|
Loading…
Reference in New Issue