mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user