mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Merge pull request #73 from bmaurer/smallmalloc
Smaller malloc hot path
This commit is contained in:
commit
3e3caf03af
8 changed files with 194 additions and 194 deletions
|
|
@ -526,7 +526,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));
|
||||
|
|
@ -569,7 +569,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