Allocate increasingly large base blocks.

Limit the total number of base block by leveraging the exponential
size class sequence, similarly to extent_grow_retained().
This commit is contained in:
Jason Evans
2017-04-16 18:39:14 -07:00
parent 675701660c
commit 69aa552809
2 changed files with 44 additions and 27 deletions

View File

@@ -21,11 +21,18 @@ struct base_s {
* User-configurable extent hook functions. Points to an
* extent_hooks_t.
*/
atomic_p_t extent_hooks;
atomic_p_t extent_hooks;
/* Protects base_alloc() and base_stats_get() operations. */
malloc_mutex_t mtx;
/*
* Most recent size class in the series of increasingly large base
* extents. Logarithmic spacing between subsequent allocations ensures
* that the total number of distinct mappings remains small.
*/
pszind_t pind_last;
/* Serial number generation state. */
size_t extent_sn_next;