mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-05 18:06:14 +03:00
Quantize szad trees by size class.
Treat sizes that round down to the same size class as size-equivalent in trees that are used to search for first best fit, so that there are only as many "firsts" as there are size classes. This comes closer to the ideal of first fit.
This commit is contained in:
parent
f044bb219e
commit
5707d6f952
4 changed files with 38 additions and 13 deletions
|
|
@ -73,7 +73,7 @@ void *
|
|||
base_alloc(size_t size)
|
||||
{
|
||||
void *ret;
|
||||
size_t csize;
|
||||
size_t csize, usize;
|
||||
extent_node_t *node;
|
||||
extent_node_t key;
|
||||
|
||||
|
|
@ -83,7 +83,8 @@ base_alloc(size_t size)
|
|||
*/
|
||||
csize = CACHELINE_CEILING(size);
|
||||
|
||||
extent_node_init(&key, NULL, NULL, csize, false);
|
||||
usize = s2u(csize);
|
||||
extent_node_init(&key, NULL, NULL, usize, false);
|
||||
malloc_mutex_lock(&base_mtx);
|
||||
node = extent_tree_szad_nsearch(&base_avail_szad, &key);
|
||||
if (node != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue