mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Create a const array with only a small bin to size map
This commit is contained in:
parent
6c39f9e059
commit
021136ce4d
5 changed files with 17 additions and 7 deletions
|
|
@ -602,7 +602,7 @@ s2u(size_t size)
|
|||
{
|
||||
|
||||
if (size <= SMALL_MAXCLASS)
|
||||
return (arena_bin_info[SMALL_SIZE2BIN(size)].reg_size);
|
||||
return (small_bin2size[SMALL_SIZE2BIN(size)]);
|
||||
if (size <= arena_maxclass)
|
||||
return (PAGE_CEILING(size));
|
||||
return (CHUNK_CEILING(size));
|
||||
|
|
@ -645,7 +645,7 @@ sa2u(size_t size, size_t alignment)
|
|||
|
||||
if (usize <= arena_maxclass && alignment <= PAGE) {
|
||||
if (usize <= SMALL_MAXCLASS)
|
||||
return (arena_bin_info[SMALL_SIZE2BIN(usize)].reg_size);
|
||||
return (small_bin2size[SMALL_SIZE2BIN(usize)]);
|
||||
return (PAGE_CEILING(usize));
|
||||
} else {
|
||||
size_t run_size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue