mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 00:23:33 +03:00
Add size class computation capability.
Add size class computation capability, currently used only as validation of the size class lookup tables. Generalize the size class spacing used for bins, for eventual use throughout the full range of allocation sizes.
This commit is contained in:
parent
99118622ff
commit
d04047cc29
9 changed files with 462 additions and 91 deletions
|
|
@ -475,7 +475,7 @@ s2u(size_t size)
|
|||
{
|
||||
|
||||
if (size <= SMALL_MAXCLASS)
|
||||
return (small_bin2size(small_size2bin(size)));
|
||||
return (small_s2u(size));
|
||||
if (size <= arena_maxclass)
|
||||
return (PAGE_CEILING(size));
|
||||
return (CHUNK_CEILING(size));
|
||||
|
|
@ -518,7 +518,7 @@ sa2u(size_t size, size_t alignment)
|
|||
|
||||
if (usize <= arena_maxclass && alignment <= PAGE) {
|
||||
if (usize <= SMALL_MAXCLASS)
|
||||
return (small_bin2size(small_size2bin(usize)));
|
||||
return (small_s2u(usize));
|
||||
return (PAGE_CEILING(usize));
|
||||
} else {
|
||||
size_t run_size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue